|
Question : Combo Box problem with access the selected item
|
|
I have a combo box named Customer. I populate Customer with the following query: SELECT FU.Salesman, FU.Customer, FU.InvoiceNumber, FU.[Date Entered] FROM FUWHERE (((FU.Salesman)=forms!FRMSELFOllow!Salesman)) order by FU.Salesman, FU.Customer, FU.InvoiceNumber,FU.[Date Entered] desc,
The following data appears (I have shortened the list) Control Source is blank
Salesman Customer Invoice Number Date to be Paid CHRIS APPL 9656 02/282005 CHRIS APPL 9656 01/31/2005 CHRIS APPL 9656 12/31/2005 CHRIS APPL 9656RTN 02/282005
I click on the last record for Invoice Number 9656RTN
I have a AFTER UPDATE event with the following code The purpose of this code is to filter the records for the Salesman Customer and Invoice Dim Customer As String, invoice As String, Salesman As String, strSQL As String, CustomerFilter As String, InvoiceFilter As String Dim FormFilter As String Me.Requery Customer = Me.Customer.Column(1) invoice = Me.Customer.Column(2) Me.FilterOn = False Me.Filter = "[Customer] = '" & Customer & "'" & "and [InvoiceNumber] = '" & invoice & "'" Me.FilterOn = True Me.Requery
The value for Me.Customer.Column(1) is APPL The value for Me.Customer.Column(2) is 9656 WHICH IS WRONG
Please let me know what I am doing wrong..
Thanks..
Les.
|
|
Answer : Combo Box problem with access the selected item
|
|
Me.Requery is probably requerying your combo box, which means your selected value doesn't stay selected. Get rid of that line and run your code again.
Hope this helps. -Jim
|
|
|
|