Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

parameter query

Status
Not open for further replies.

dgabriela

Programmer
Sep 16, 2002
14
0
0
CA
Hi All!
I have an append query to which I'd like to pass as parameter the value of a combobox from a form.
So in the query definition grid I put [strParam] for the ITEM field which I want to pass, in Query->Parameters I defined [strParam] as text. In the form I'm doing the following but it doesn't work... I get the error "too few parameters":

Dim strPARAM As Parameter
Set qdf = dbf.QueryDefs("QueryS4")
qdf.Parameters!strPARAM = Me.ComboItem.[Column](0)
qdf.Execute

Could you please help me pass the combobox value to my query?
Thank you, Gabriela.
 
I've not worked with qdef so someone will no doubt give the proper answer!

But is there a reason why you can't reference the Combo directly in the query grid ie change the criteria from strPARAM to:

Forms![yourform]![ComboItem] Nigel
Didn't someone say work is supposed to be fun? They didn't have computers then I guess....
 
Thanks for you answer Nigel!
I've just found the problem was in another place but the Access message was confusing... Actually I was missing a field from a table...
Work can be fun again ?! :)
Gabriela.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top