Hi all,
I have 2 tables. One called customer and one called order.
I created a form caled frmorder and when you open it you can add a new order. You will see an orderID and a customer ID wich is a locked textfield. Underneath the customerID I have 2 unliked textboxes with are called name and firstname. In the cusomerID text fields afterupdate I have the code
txtname = DLookup("name", "customer", "cusomerID=" & me.customerID)
txtfirstname = DLookup("firstname", "customer", "cusomerID=" & me.customerID)
So when customerID changes the fields below get automaticaly filled in with name and fistname.
Now next to the customer ID field I have a button witch opens a new form. Some kind of search form I created where you can search customers. When you close this form it will change customerID on the order form in the customer ID you selected on the search form.
I supposed the afterUpdate would be triggered so that the name and fistname would be refreshed to but this is not happening?? Howcome?
the code in the search form is easy and it fills in customer ID on frmOrder. but does not trigger any afterUpdate or change event.
private sub btnclose_Click()
Form_frmOrder.customerID.Value = [customerID]
DoCmd.Close acForm, Me.Name
end sub
Tanks in advance.
tank you,
best regards,
Lord_Garfield
I have 2 tables. One called customer and one called order.
I created a form caled frmorder and when you open it you can add a new order. You will see an orderID and a customer ID wich is a locked textfield. Underneath the customerID I have 2 unliked textboxes with are called name and firstname. In the cusomerID text fields afterupdate I have the code
txtname = DLookup("name", "customer", "cusomerID=" & me.customerID)
txtfirstname = DLookup("firstname", "customer", "cusomerID=" & me.customerID)
So when customerID changes the fields below get automaticaly filled in with name and fistname.
Now next to the customer ID field I have a button witch opens a new form. Some kind of search form I created where you can search customers. When you close this form it will change customerID on the order form in the customer ID you selected on the search form.
I supposed the afterUpdate would be triggered so that the name and fistname would be refreshed to but this is not happening?? Howcome?
the code in the search form is easy and it fills in customer ID on frmOrder. but does not trigger any afterUpdate or change event.
private sub btnclose_Click()
Form_frmOrder.customerID.Value = [customerID]
DoCmd.Close acForm, Me.Name
end sub
Tanks in advance.
tank you,
best regards,
Lord_Garfield