Originally posted by NeoPa
Check Boxes to Pass into Query
Collapse
X
-
Yeah all the data is gone, just the "shell" i suppose. I sent it to you though.Originally posted by NeoPaROFLMAO.
You didn't forget to delete all the data first by any chance did you? That could make it work. You'd have to Compact & Repair after that again though, and Zip it up again.Comment
-
I will be here at my Comp for about an hour and 1/2, then I have to go on a trip. I may have access to access (ha) during the weekend, but I am not sure. I will be back in the office Tuesday Morning US Central Time 13:36 here now. Thanks again.Originally posted by NeoPaYes - the 'Shell'.
But in there is pretty well all the important logic etc.
This should help greatly.
L8rs -Adrian.Comment
-
Ok thank you very much. Have a good weekend. Quit question, Are you working this late, or are you on your own time helping me? Either way I am Tremendously appreciative.Originally posted by NeoPaIn truth, I doubt I'll be able to do much in that time although it's not impossible.
I'll try to leave you something for your return at least though.Comment
-
Right, I'll try to post in here all the issues I come across while looking at your database so that you get the feedback, but also anyone reading the thread will be able to follow what's happened.
Firstly I notice that this is an Access 97 database.Comment
-
The page you use with all the CheckBoxes on is essentially a sibling of the two pages (subforms) you want to populate when you click the command buttons.
This means that the strFilter will need to be available globally (available to all procedures for the whole form) I'll have to look into what is available where between different form objects within subform objects of a main form.
I'll repost when I've made some progress.Comment
-
Originally posted by NeoPaThe page you use with all the CheckBoxes on is essentially a sibling of the two pages (subforms) you want to populate when you click the command buttons.
This means that the strFilter will need to be available globally (available to all procedures for the whole form) I'll have to look into what is available where between different form objects within subform objects of a main form.
I'll repost when I've made some progress.
Ok thanks.Comment
-
You weren't due back till Tuesday! Surprise.Originally posted by ChaseCoxOk thanks.
I think I need another review on this. Let me know what's still outstanding when you check out all that's there since you left (I hope there's some actual info there and not just rambles about versions etc). At least I should understand better where you're coming from.
I think accessing Pages on the main form is transparent. I mean referring to a control on one page from another should still be Me.ControlName. Can you check this is right when you get a minute. I can't really run the database as there's no data (and finding time will be difficult too).Comment
-
HOORAY. After spending all day I got it to work. Here is what I did.
I am passing the product codes into a text box that is then referenced by a query string:Code:Private Sub chkvoy2_AfterUpdate() Call MakeFilter End Sub Private Sub chkvoy3_AfterUpdate() Call MakeFilter End Sub Private Sub chkchil_AfterUpdate() Call MakeFilter End Sub Private Sub chkipk_AfterUpdate() Call MakeFilter End Sub Private Sub chkody_AfterUpdate() Call MakeFilter End Sub Private Sub chkpre_AfterUpdate() Call MakeFilter End Sub Private Sub chkwsp_AfterUpdate() Call MakeFilter End Sub Private Sub MakeFilter() strFilter = "" If Nz(chkvoy2, False) Then _ strFilter = strFilter & ",'0463','0465','0467'" If Nz(chkvoy3, False) Then _ strFilter = strFilter & ",'0382'" If Nz(chkipk, False) Then _ strFilter = strFilter & ",'0383','0393','0422'" If Nz(chkody, False) Then _ strFilter = strFilter & ",'0419','0411','0416','0418'" If Nz(chkpre, False) Then _ strFilter = strFilter & ",'0281','0282','0279','0280'" & _ ",'0284','0287','0513','0514'" & _ ",'0515','0516','0517','0518'" If Nz(chkwsp, False) Then _ strFilter = strFilter & ",'0328','0331','0176','0075'" & _ ",'0326','0332','0042','0142'" If Nz(chkchil, False) Then _ strFilter = strFilter & ",'0361','0362','0385','0386'" [txtsee] = strFilter End Sub Private Sub Command78_Click() On Error GoTo Err_Command78_Click txtsee.SetFocus If Nz(chkmat, False) Then _ DoCmd.OutputTo acOutputQuery, "Material Query", acFormatXLS, "", False End If Forms![Form1]![Practice].Form.RecordSource = "Material Query" Exit_Command78_Click: Exit Sub Err_Command78_Click: MsgBox Err.Description Resume Exit_Command78_Click End Sub Private Sub Lbrbutton_Click() On Error GoTo Err_Lbrbutton_Click txtsee.SetFocus If Nz(chklab, False) Then _ DoCmd.OutputTo acOutputQuery, "Labor Query", acFormatXLS, "", False End If Forms![Form1]![Practice1].Form.RecordSource = "Labor Query" Exit_Lbrbutton_Click: Exit Sub Err_Lbrbutton_Click: MsgBox Err.Description Resume Exit_Lbrbutton_Click End Sub
may not be elegant, but it works!Code:InStr([Forms]![Form1]![txtsee].[Text],[Prod_Code])
Comment
-
Your code actually answered my main question Chase.Originally posted by ChaseCoxI am not sure If I understood what you were asking for in the last post. I am still stuck where I was on Friday.
Pages (where you have multiple tabs) are not treated as part of the reference structure.
So, if I want to reference the SubForm from outside of it, I don't need to include a part for the page. That is determined automatically by the interpreter knowing which items are on each page.
That solution may not be elegant, but if it works that should be fine.
What I was thinking of (and I'll go into more detail if (only if) you express an interest) was to leave the record source as it is (without any connection to the form) and simply apply a Filter to the form in the SubForm when required.
This way we avoid messy references to Form.Control's current values within the SQL.
If you've got what you want and are happy with it though, that's cool.Comment
Comment