If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Difference criteria from different forms
I have messed with this for a while now and can get it to work. I have two
different tabs (in a tab control) that have basically the same combo box which is a "Job#". There is a report button next to each of the combo box's that will run the same report. So if someone chose Job# ABC in tab 1 then navigated over to tab 2 and chose Job # 123 then clicks the report button on next to job# 123 the query criteria for "Job#" should use 123. however if they went back to tab 1 and hit the report button next to Job ABC then the query criteria for job# should use ABC. So I want an event to fire off when the report button on tab 1 is clicked that would have the report use the combo box in tab 1 the criteria and vice versa. I can't seem to find the right code for the on click event. -- Message posted via http://www.accessmonster.com |
#2
|
|||
|
|||
Difference criteria from different forms
Szag,
Why not set the parameter when openening the report. This could look something like this: docmd.openreport "reportname",,, "job#= '" & me.combobox & "'" if you are dealing with numerical values lose the apostrophs like: docmd.openreport "reportname",,, "job#= " & me.combobox replace the reportname with the name of your report and replace the job# with the name you are using in the query and replace the me.combobox with the name you are using for the combobox. hth -- Maurice Ausum "szag via AccessMonster.com" wrote: I have messed with this for a while now and can get it to work. I have two different tabs (in a tab control) that have basically the same combo box which is a "Job#". There is a report button next to each of the combo box's that will run the same report. So if someone chose Job# ABC in tab 1 then navigated over to tab 2 and chose Job # 123 then clicks the report button on next to job# 123 the query criteria for "Job#" should use 123. however if they went back to tab 1 and hit the report button next to Job ABC then the query criteria for job# should use ABC. So I want an event to fire off when the report button on tab 1 is clicked that would have the report use the combo box in tab 1 the criteria and vice versa. I can't seem to find the right code for the on click event. -- Message posted via http://www.accessmonster.com . |
#3
|
|||
|
|||
Difference criteria from different forms
this worked perfect. One small problem. If I add a subreport to this report
what would be the best way of assigning the link child field the same values as Job# ? Maurice wrote: Szag, Why not set the parameter when openening the report. This could look something like this: docmd.openreport "reportname",,, "job#= '" & me.combobox & "'" if you are dealing with numerical values lose the apostrophs like: docmd.openreport "reportname",,, "job#= " & me.combobox replace the reportname with the name of your report and replace the job# with the name you are using in the query and replace the me.combobox with the name you are using for the combobox. hth I have messed with this for a while now and can get it to work. I have two different tabs (in a tab control) that have basically the same combo box [quoted text clipped - 8 lines] that would have the report use the combo box in tab 1 the criteria and vice versa. I can't seem to find the right code for the on click event. -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/For...forms/201002/1 |
Thread Tools | |
Display Modes | |
|
|