Query problem: IIf & Like combination

JiTS

Ciao!
Local time
Today, 21:35
Joined
Dec 12, 2003
Messages
77
Hi,

Problemsituation:
I have a form with a combo box and a check box (see attachment). The combo box is able to show me productcodes
such as 'VB0101' and 'VC0101'. If the check box is checked (true) and I click on the combo box, I only want to see the productscodes that begins with 'VB....'. If the check box is not checked then I only see the productcodes that begins with 'VC....'.

Behind the combo box is a query. In the criteria I added the following line:

Like IIf([Forms]![frmAanvoergegevens]![chkBio]=True;"VB*";"VC*")

chkBio = check box

Problem:
If I am using the form I only gets the 'VB....' productcodes.

Question:
What's wrong in the line?

Please help... :confused:
 

Attachments

  • problemsituation.jpg
    problemsituation.jpg
    15.5 KB · Views: 150
Put a line of code in the After Update event of the check box to requery the combo box:-
Code:
Private Sub chkBio_AfterUpdate()
  Me.[b]yourComboBoxName[/b].Requery
End Sub
 
That's it!

Thanks for your help, it works perfectly! ;)

BTW... happy new year to everyone in the world of Access!

See ya,
JiTS :D
 

Users who are viewing this thread

Back
Top Bottom