Hi All,
I have a combobox called BillTo, and after a selection is made, another combobox named ShipTo is requeried for corresponding records.
I made the following code, but it does not do what i want.
I am looking to populate bound Ship to fields with the info in the BillTo combobox upon requery of the ShipTo combobox being empty.
The problem seems to be that i dont know how to determine correctly if the query of ShipTo is or is not empty.
Please help!!!
by the way, the comboboxes are set up correctly and function fine when there are corresponding records.
Here is my code:
Private Sub BillTo_AfterUpdate()
ShipTo.Requery
ShipTo.SetFocus
ShipTo.Dropdown
If ShipTo.Value = 0 Then
ShipToCustomer = BillTo.Column(1)
ShipToAddress1 = BillTo.Column(2)
ShipToAddress2 = BillTo.Column(3)
ShipToAddress3 = BillTo.Column(4)
ShipToCity = BillTo.Column(5)
ShipToState = BillTo.Column(6)
ShipToZip = BillTo.Column(7)
ShipToCountry = BillTo.Column(8)
ShipToAttention = BillTo.Column(9)
Else
BillTo.SetFocus
End If
End Sub
I have a combobox called BillTo, and after a selection is made, another combobox named ShipTo is requeried for corresponding records.
I made the following code, but it does not do what i want.
I am looking to populate bound Ship to fields with the info in the BillTo combobox upon requery of the ShipTo combobox being empty.
The problem seems to be that i dont know how to determine correctly if the query of ShipTo is or is not empty.
Please help!!!
by the way, the comboboxes are set up correctly and function fine when there are corresponding records.
Here is my code:
Private Sub BillTo_AfterUpdate()
ShipTo.Requery
ShipTo.SetFocus
ShipTo.Dropdown
If ShipTo.Value = 0 Then
ShipToCustomer = BillTo.Column(1)
ShipToAddress1 = BillTo.Column(2)
ShipToAddress2 = BillTo.Column(3)
ShipToAddress3 = BillTo.Column(4)
ShipToCity = BillTo.Column(5)
ShipToState = BillTo.Column(6)
ShipToZip = BillTo.Column(7)
ShipToCountry = BillTo.Column(8)
ShipToAttention = BillTo.Column(9)
Else
BillTo.SetFocus
End If
End Sub