Combo Box

  • Thread starter Thread starter Joan
  • Start date Start date
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?
 
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.
 
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?
.
.
 
Back
Top