Kckronic21
Programmer
Hi,
I have a question. I have a Center query which looks for the control in the Center form. The criteria in the Center query set up like this: [Forms]![Center_Form]![Center_Name_txtbox].
On the Center form, I have a combo box that list all of the centers from the center table. I created a report based on the Center query that shows one report for each center. The report header has a control source like this: [Forms]![Center_Form]![Center_Name_txtbox]. I have placed a button on the form that prints all of the centers when it is pressed. The Visual Basic code that I have been putting in on that button is like this:
Private Sub CmdPrintAlloftheCentersButton_Click()
[Center_Name_txtbox] = "Center Name 1"
On Error GoTo Err_CmdPrintAlloftheCentersButton_Click
Dim stDocName As String
stDocName = "Center_Report"
DoCmd.OpenReport stDocName, acNormal
[Center_Name_txtbox] = "Center Name 2"
My question is there a way for me to get Access to look at the values that are in the center table (the center names) so that I don’t have to rewrite the same VBA code for each center?
Thanks
I have a question. I have a Center query which looks for the control in the Center form. The criteria in the Center query set up like this: [Forms]![Center_Form]![Center_Name_txtbox].
On the Center form, I have a combo box that list all of the centers from the center table. I created a report based on the Center query that shows one report for each center. The report header has a control source like this: [Forms]![Center_Form]![Center_Name_txtbox]. I have placed a button on the form that prints all of the centers when it is pressed. The Visual Basic code that I have been putting in on that button is like this:
Private Sub CmdPrintAlloftheCentersButton_Click()
[Center_Name_txtbox] = "Center Name 1"
On Error GoTo Err_CmdPrintAlloftheCentersButton_Click
Dim stDocName As String
stDocName = "Center_Report"
DoCmd.OpenReport stDocName, acNormal
[Center_Name_txtbox] = "Center Name 2"
My question is there a way for me to get Access to look at the values that are in the center table (the center names) so that I don’t have to rewrite the same VBA code for each center?
Thanks