Passing Parameters via VB

D

DawnP277

I have a report that contains 2 graphs that work off the same query but
different fields.

Also on the report I have test data information that is pulled from a
different query.

I am trying to create an event procedure on a button that will print the
report. However when I click the button I am prompted three different times
for the same Serial Number.

Is there away that I can have an input box that will ask for the serial
number and pass this parameter to the queries so the person will only be
prompted once for that information.

Thank you in advance for any help.
 
D

DawnP277

I did think to write my query in SQl but then how do I get the report linked
to the SQL query in the code.

If I write
Dim strCriteria As String

Prompt:
strCriteria = InputBox("Enter Serial Number")

Select qryReprintLabel.*
From qryReprintLabel
Where Sample = strCriteria

I have a report to print the label how do I get them insink?

Thank you
 
D

Duane Hookom

An InputBox() has about the same problems as parameter prompts. Why not just
have a combo box on a form that allows the users to select a serial number
from a list? Then use this control to build a where condition for the
DoCmd.OpenReport method.
 
D

DawnP277

The problem is that we have a software called OPTO that runs the testing that
we are going to import the data into. The serial number is inputed into OPTO
by the operator based on date codes and materials,

I currently do not have a form since I am importing directly and just need
to print the graphs and test data and create a label that goes on the product.

The operator does not enter any information.

The button is on a switchboard that I just want to import the data, create
the report (2 graphs, test data) and than print the label.

I have this working by using a query that looks for the last record finds
the serial number and creates everythinh.

My problem is if they try to reprint aa report or label, which I was having
them do from a button, How do I get the serial number to be held and used
for the 2 graphs and the report and than the label.

Thank you
 
D

DawnP277

Sorry, I thought about what you said.

I created a combobox on my form (switchboard ) that I used the wizard to
create my dropdown list. How do I get the combobox refreshed after new data
has been imported into the database?

I can use the control field inside my queries.

Thanks for your suggestions.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top