stormin_norm
Registered User.
- Local time
- Today, 18:45
- Joined
- Apr 23, 2003
- Messages
- 213
I have a simple form with text box and list box called frmCustSelect.
User enters last name in text box, and the list box is populated with matching user records (using like [Forms]...&"*" in lookup query to get all jon* records when user keys in 'jon')
This works great.
Now user scrolls through the list box and double clicks on the entry jones, mary. And a new form pops up called frmCustomer.
If I go back to frmCustSelect and doubleclick on a different entry, the underlying query is never updated, and therefore frmCustomer is not changed.
If I close frmCustomer, and then doublick on a listbox entry, the frmCustomer opens with the new record. Is this because a new query thread is started each time???
Simple code ex:
-------------------
frmCustSelect
Private Sub txtLastName_AfterUpdate()
lbCustomerSelection = Null
lbCustomerSelection.Requery
End Sub
Private Sub lbCustomerSelection_DblClick(Cancel As Integer)
DoCmd.OpenForm ("frmCustomer")
End Sub
------------------------
----------------------
frmCustomer
RecordSource = qryCust
Misc fields from qryCust
------------------------
-----------------------
qryCust
SELECT Customer.*, Customer.CustID
FROM Customer
WHERE (((Customer.CustID)=[Forms]![frmCustSelect]![lbCustomerSelection]));
-----------------------
User enters last name in text box, and the list box is populated with matching user records (using like [Forms]...&"*" in lookup query to get all jon* records when user keys in 'jon')
This works great.
Now user scrolls through the list box and double clicks on the entry jones, mary. And a new form pops up called frmCustomer.
If I go back to frmCustSelect and doubleclick on a different entry, the underlying query is never updated, and therefore frmCustomer is not changed.
If I close frmCustomer, and then doublick on a listbox entry, the frmCustomer opens with the new record. Is this because a new query thread is started each time???
Simple code ex:
-------------------
frmCustSelect
Private Sub txtLastName_AfterUpdate()
lbCustomerSelection = Null
lbCustomerSelection.Requery
End Sub
Private Sub lbCustomerSelection_DblClick(Cancel As Integer)
DoCmd.OpenForm ("frmCustomer")
End Sub
------------------------
----------------------
frmCustomer
RecordSource = qryCust
Misc fields from qryCust
------------------------
-----------------------
qryCust
SELECT Customer.*, Customer.CustID
FROM Customer
WHERE (((Customer.CustID)=[Forms]![frmCustSelect]![lbCustomerSelection]));
-----------------------