I have different Resort hotels in my file. There are 3 styles of paperwork for a hotel because of their preference.
I built a table which i need to correlate to my form button to find the desired report to print for that hotel.
The ResortID is on the form as the source. BusID field too.
The table has the following fields in tblReport: (I wish they had not used the # in the name below)
BusID, Resort#, ReportNum, ReportName
(busID means business ID)
Here is an example of the 4 fields:
1
Notice that resortID's 238 and 567 use rpt8035 for reportNum88. The 480 resort uses rpt8088, which is a different styled report.
In my Form button, I have:
Private Sub cmd88_Click()
DoCmd.OpenReport "rpt8035", acViewPreview
End Sub
I need the above code to search tblReport, look for the busID, then the ResortID and then the ReportNum,
and then use whatever report is noted in the Reportname column of tblReport.
So I need my DoCmd to be flexible. I need the rpt8035 to be erased and new code
to search tblReport for the 3 fields, then it would run the report name shown in the reportname field of tblReport.
It would also be nice to have something at the end that says something like,
"could not find a report for this hotel".
Clear as mud??
Thank you for reviewing. Currently, we have about 30 form buttons on a form.
They can be replaced by just ONE form button that would look into tblReport for the
desired reportname to run. This way, the girls do not have to stop and ask themselves,
which of the 30 buttons do they pick from for a given hotel. My method would do the trick
for them as long as they picked the hotel or ResortID on the main form.
thanks
I built a table which i need to correlate to my form button to find the desired report to print for that hotel.
The ResortID is on the form as the source. BusID field too.
The table has the following fields in tblReport: (I wish they had not used the # in the name below)
BusID, Resort#, ReportNum, ReportName
(busID means business ID)
Here is an example of the 4 fields:
1
238
20rpt1234
1238
88rpt8035
1480
20rpt1234
1480
30rpt3333
1480
88rpt8088
1567
88rpt8035
Notice that resortID's 238 and 567 use rpt8035 for reportNum88. The 480 resort uses rpt8088, which is a different styled report.
In my Form button, I have:
Private Sub cmd88_Click()
DoCmd.OpenReport "rpt8035", acViewPreview
End Sub
I need the above code to search tblReport, look for the busID, then the ResortID and then the ReportNum,
and then use whatever report is noted in the Reportname column of tblReport.
So I need my DoCmd to be flexible. I need the rpt8035 to be erased and new code
to search tblReport for the 3 fields, then it would run the report name shown in the reportname field of tblReport.
It would also be nice to have something at the end that says something like,
"could not find a report for this hotel".
Clear as mud??
Thank you for reviewing. Currently, we have about 30 form buttons on a form.
They can be replaced by just ONE form button that would look into tblReport for the
desired reportname to run. This way, the girls do not have to stop and ask themselves,
which of the 30 buttons do they pick from for a given hotel. My method would do the trick
for them as long as they picked the hotel or ResortID on the main form.
thanks