combo box in search screen slightly misbehaving

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a drop down combo box called "origmedia" on a search form that has
other fields.
It's default value is ""
te acceptable values are "";"Digital";"A4";" A3";"A2";"A5"
The reason for "" is that if that is selected then when it searches the
records then it ignores this field.

When initially opening the form and run a search, If I don't select a value
in this combo box (origmedia) or select the blank entry, no results are
found. However if I select say "digital", run a search, then select the
blank line and do another search then it searches ok.

If I run the query with the form closed, and input nothing for the parameter
input for the combo box it searches ok.

The rest of the form works ok (although I ideally need to add a clear all
button)
 
I believe the problem is you are treating "" and Null as the same thing
and they are not. I don't know what your code is so I cannot say for
certain. You might try setting a breakpoint in your code and stepping
through it, checking the value of origmedia when you run it. That
might help you debug your problem.
 
I was not aware that they were differant. With regards to the "code" - I am
using whatever access created when I was in form design and query design.
Unfortunatly I'm not clued up on vba or sql programming.

In The Query
"pagesize" field has [forms]![artsearchkeyword]![origmedia]

The query rows that don't have this field filled out have
a colum headed [forms]![artsearchkeyword]![origmedia] which has value IS
Null.

In form design the combo box has as the values to select from
"Digital";"A4";"A3";"A2";"A5";""

the reason for "" is a blank entry for if media is irelevant to your search.
Should I have "" instead of IS Null in my query column?
I will try replacing the bland line with "Any media" and replace the Is Null
in the query with "Any Media" and see if that solves this problem.
 
The reason your query was working the second time was because you
changed the value to Null when you deleted the value from your field.
Now the query with IS Null will work. It sounds to me from what you
have described that you need to remove the defaulted value of "" from
the combo box and do not have a default at all. When you open the
form, that combo box will be Null and your query should run as expected.
 
Thanks.

I got it working properly by having a entry in the combo box "All Media" and
tested for that in the query insead of for Is Null.
 
Back
Top