Hello everyone,
I experience the following problem.
I have form1(datasheet view) which get records from table1.
In this Form1 there are 4 fields customer_id,Name,Surname and Address.
Address is a combo box which gets records from a query (customers_and_address_query :
SELECT cust.customer_id,cust.name,cust.surname, addr.street
FROM cust INNER JOIN addr ON cust.customer_id = addr.customer_id
WHERE (((cust.customer_id)=[Forms]![Form1]![customer_id]));
)
The problem is that when i choose an address from the combobox for a specific customer(e.g. the 1st record of the Form1) ,when i move to another record ,the records of that combobox are still the same as the ones of the 1st record(1st customer).
I tried the following code but the problem persists.address1 is the name of the combobox.
Private Sub address1_AfterUpdate()
Me!address1.Requery
End Sub
Additionaly,if i select something from the combobox for the 1st record-customer of the Form1 its ok,but when i move to the 2nd record of the Form1 and try to select something from the combobox (it has similar records regarding the records of the combo for the 1st record of the form as i explained above) ,the record of the combo for the 1st customer of the Form1 disappears!!!
Can anyone help me with these 2 problems???
Thank you in advance!
I experience the following problem.
I have form1(datasheet view) which get records from table1.
In this Form1 there are 4 fields customer_id,Name,Surname and Address.
Address is a combo box which gets records from a query (customers_and_address_query :
SELECT cust.customer_id,cust.name,cust.surname, addr.street
FROM cust INNER JOIN addr ON cust.customer_id = addr.customer_id
WHERE (((cust.customer_id)=[Forms]![Form1]![customer_id]));
)
The problem is that when i choose an address from the combobox for a specific customer(e.g. the 1st record of the Form1) ,when i move to another record ,the records of that combobox are still the same as the ones of the 1st record(1st customer).
I tried the following code but the problem persists.address1 is the name of the combobox.
Private Sub address1_AfterUpdate()
Me!address1.Requery
End Sub
Additionaly,if i select something from the combobox for the 1st record-customer of the Form1 its ok,but when i move to the 2nd record of the Form1 and try to select something from the combobox (it has similar records regarding the records of the combo for the 1st record of the form as i explained above) ,the record of the combo for the 1st customer of the Form1 disappears!!!
Can anyone help me with these 2 problems???
Thank you in advance!