Solved Is it possible to incorporate a query parameter in VBA? (1 Viewer)

L1l_m5_P1gg13

New member
Local time
Today, 20:26
Joined
May 14, 2020
Messages
7
Hello All,

I am hoping to get some help with VBA to print a label in Access.

I have an Access Report that pulls through a Serial Number and an IMEI Number, using a query parameter the user is asked for a serial number. Once this is entered the serial number and corresponding IMEI populate onto the report.

What I am trying to achieve is, when the user clicks the OK after entering the serial number (the query parameter) the OK runs code to populate the report and print automatically, then clearing the Report ready for the next serial number to be entered.

I know through VBA I can get this done, but I haven't seen how I could incorporate this into the parameter value section.

Any help would be greatly appreciated! Thank you :)
 

onur_can

Active member
Local time
Today, 13:26
Joined
Oct 4, 2015
Messages
180
In the query design window, set [Enter Serial Number] to the criterion line of the serial number field.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 04:26
Joined
May 7, 2009
Messages
19,169
you may also try to use Form (frmReportParam) to collect the serial number (txtSerialNo).
use Forms!frmReportParam!txtSerialNo as parameter of your query.
there is a button on the Form that calls the Report for PrintOut.
 

L1l_m5_P1gg13

New member
Local time
Today, 20:26
Joined
May 14, 2020
Messages
7
you may also try to use Form (frmReportParam) to collect the serial number (txtSerialNo).
use Forms!frmReportParam!txtSerialNo as parameter of your query.
there is a button on the Form that calls the Report for PrintOut.
Thank you for your help, much appreciated!
 

L1l_m5_P1gg13

New member
Local time
Today, 20:26
Joined
May 14, 2020
Messages
7
Hello All,

I am hoping to get some help with VBA to print a label in Access.

I have an Access Report that pulls through a Serial Number and an IMEI Number, using a query parameter the user is asked for a serial number. Once this is entered the serial number and corresponding IMEI populate onto the report.

What I am trying to achieve is, when the user clicks the OK after entering the serial number (the query parameter) the OK runs code to populate the report and print automatically, then clearing the Report ready for the next serial number to be entered.

I know through VBA I can get this done, but I haven't seen how I could incorporate this into the parameter value section.

Any help would be greatly appreciated! Thank you :)

For some reason it will not let me reply to the last two comments, so I wanted to post a thank you here for your help. I really appreciate it! Thank you!
 

Users who are viewing this thread

Top Bottom