Query problem

ilse20

Registered User.
Local time
Tomorrow, 00:10
Joined
Apr 9, 2010
Messages
35
i have a question, i don't know if it can be done

i'm working with vba access.
here is my problem.

i have a table, from that table i made a query and from that query i made a report.
he executes the query perfectly, but i've added a where clause to it and every time i run the query or the report i get a pop-up box where i have to enter the value of the where clause.

if i enter the value there then it works perfectly.

the value i want is a variable, which must be retrieved from the access system.

this is my query:
SELECT Generate_labels.ChangeUserName, Generate_labels.pronum, Generate_labels.Finishing, Generate_labels.Colour, Generate_labels.Ref_num_buyer, Generate_labels.Date
FROM Generate_labels
WHERE ChangeUserName = ChosenName;

ChangeUserName is de fieldname in the table and ChosenName is the variable that i use, this one i have to enter each time in the pop-up box

ChosenName is a variable that is in the VBA script. It is different for each user. ChosenName is the name from the user that is logged in.

is there a way i can execute the query without getting the pop-up box?

thanx

ilse
 
ChosenName is not in the query so your Where clause has nothing to go on.

Col
 
yes i know that, but it is a variable that is somewhere in my vba code in access. so i want to know if it is possible to retrieve that variable from the vba code to the query without that pop-up box
 

Users who are viewing this thread

Back
Top Bottom