|
-
Mar 31st, 2005, 08:19 AM
#1
Thread Starter
New Member
Problem with combo box and empty string - Access
I have two combo boxes on a form. When I select "Type" from first one, then the second combo box will show records that match the chosen "Type". I do this by querying a table, using a LIKE sql operator. The query is initiated by running a macro with "After Update" property on the "Type" combo box. When the form is opened, the initial value is "*" for the "Type" combo box, and so initially I can see all of the fields in the second box.
The above mentioned procedure works fine, but I would also like to add the function that if the "Type" combo box is cleared, then it's value would automatically be set back to "*" and again all of the fields in the second combo box would be shown. [I want it because if a user looks through a certain type but can't find what he's looking for - then he would be able to just clear the "Type" box and he would be able to see all of the avaiable fields WITHOUT having to type "*" into "Type" field manually]
I figured I'd add something like this to the "After Update" macro:
CONDTITION: [Forms]![frmClient_1_3_AddSnack]![Food Type]=""
ACTION: SetValue
PARAMETERS: SET [Forms]![frmClient_1_3_AddSnack]![Food Type] to "*"
However, it does not work..
I tested it by using "1" instead of "" and it worked (just for the test - I entered "1" into the field and when I clicked on the second combo box, the "1" was changed to "*" as required)
Therefore the problem seems to be with the empty string value of "" not atually being "" when I clear the field. Does anyone have any experience with this issue?
Help would be much appreciated,
burton
-
Mar 31st, 2005, 08:52 AM
#2
Thread Starter
New Member
Re: Problem with combo box and empty string - Access
Problem solved! I was suggested to change the condition to
IsNull([Forms]![frmClient_1_3_AddSnack]![Food Type])
which works!
Now that I have my solution, I guess this thread can help someone else out in a similar situation then
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|