Problem using form as criteria in query

G

Guest

I have a form with an input box that has a default value set. I then have a
query that is using this value as criteria (Forms!frmTest!txtValue). When
the query is ran the value is not being picked up in the query. Its showing
as empty. If I physically type in a value in the form it works. How do I
get a query to work with default values from a form field? I also tried
putting the Forms!frmTest!txtValue as a parameter in the query. Did not help.

Thanks in advance.
 
G

Guest

If it is a fixed default value, then try using the IIF

Where FieldName = IIF(Forms!frmTest!txtValue = "" Or Forms!frmTest!txtValue
is null,"Inser here the Default Value",Forms!frmTest!txtValue)
 

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