passing parameter to query problem

S

somersault10

I've got a query set up to receive a parameter from a combo box on a
form. The query works fine on its own, but every time it is run from
the form, no data is represented. I have done this before, but I have
never run into this problem.

I have checked all the the names and the SQL, almost obsessively, and
they're all correct. I just can't think of any other reason why the
query will not accept a parameter from the form.

Anyone have any suggestions?
 
D

Douglas J. Steele

Are you sure that what the combo box is returning is what's in the table?

Rermember that combo boxes have a BoundColumn. When you refer to the combo
box in a query, what it's seeing is the value of the bound column, which may
not be what you're seeing in the combo box.

While the form is open and something's selected, go to the Immediate Window
(Ctrl-G). Type

?Forms!NameOfForm!NameOfComboBox

and hit Enter (You need the question mark at the beginning. Replace
"NameOfForm" and "NameOfComboBox" with the appropriate names).

Is what's returned the value you're expecting?
 
G

Guest

Check the value returned from the combo,
Open the Immidiate window (Press Ctrl+G) and type
?Forms![FormName]![ComboName]

Press enter and check the value returned

Sometimes the combo is bounded to a different column from the one you want
to search on (Id instead of description)

In that case either search on the Id or change the bound column number in
the combo property
 
S

somersault10

Check the value returned from the combo,
Open the Immidiate window (Press Ctrl+G) and type
?Forms![FormName]![ComboName]

Press enter and check the value returned

Sometimes the combo is bounded to a different column from the one you want
to search on (Id instead of description)

In that case either search on the Id or change the bound column number in
the combo property

--
Good Luck
BS"D



I've got a query set up to receive a parameter from a combo box on a
form. The query works fine on its own, but every time it is run from
the form, no data is represented. I have done this before, but I have
never run into this problem.
I have checked all the the names and the SQL, almost obsessively, and
they're all correct. I just can't think of any other reason why the
query will not accept a parameter from the form.
Anyone have any suggestions?- Hide quoted text -

- Show quoted text -

That was it thanks alot for your help!!!!!!!
`
 

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