Combo Box

J

Joan

I have a combo box in the header of my form. The combo
box displays Account Number, Customer, Week of Service.
When I select the info in the combo box, it brings up the
first record associated with the Account Number. I need
the record that matches all three criteria to be
displayed. What would my code look like?
 
C

chris

In the click event of the combo you need something like ..

if mycombo.listindex < 0 then exit sub

myform.filter = "[account number] = " & mycombo.column(0,
mycombo.listindex) & " AND Customer = '" & mycombo.column
(1, mycombo.listindex) & "' AND [Week of service] = " &
mycombo.column(2, mycombo.listindex)

myform.filteron = true

with syntax corrected for field names and data types.
 
J

Joan

I tried this but I keep getting an error message....

Account Number looks like this AB0900
Customer is text
Week is a single digit
Service is a single digit

If there's any more advice you can give, I would greatly
appreciate it.....
-----Original Message-----
In the click event of the combo you need something like ..

if mycombo.listindex < 0 then exit sub

myform.filter = "[account number] = " & mycombo.column(0,
mycombo.listindex) & " AND Customer = '" & mycombo.column
(1, mycombo.listindex) & "' AND [Week of service] = " &
mycombo.column(2, mycombo.listindex)

myform.filteron = true

with syntax corrected for field names and data types.
-----Original Message-----
I have a combo box in the header of my form. The combo
box displays Account Number, Customer, Week of Service.
When I select the info in the combo box, it brings up the
first record associated with the Account Number. I need
the record that matches all three criteria to be
displayed. What would my code look like?
.
.
 

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