i have a search function where i want it to goes accordingly to what i have choose from the combo box. however it base on the my primary key to search, how can i avoid this??
i have attached a db for better understanding.
I'll keep it simple.
If you switch your columns around and put the account number in first it will display as you wish. You will need to set the columns in the two textbox controlsources differently also. There is probably more to what you want to do but for display in the textboxes on the form, this works.
if i switch the accountno to the combo box and change my sql statement. it will gives me error.
this is what i wrote for my sql:
Me.RecordSource = "SELECT Customer_Account_Table.[Branch Name],
FROM Customer_Table INNER JOIN Customer_Account_Table ON Customer_Table.NRIC = Customer_Account_Table.NRIC WHERE (((Customer_Account_Table.[Account No])=[Forms]![formName]![cboSelectGroup]));"
can u guide me what is wrong with this code.
I wasn't changing the Recordsource for the form, I just changed the RowSource for cboSelectGroup. If you reorder that then the text boxes will display what you want.
SELECT Customer_Account_Table.[Account No], Customer_Table.Name, Customer_Table.NRIC
FROM Customer_Table INNER JOIN Customer_Account_Table ON Customer_Table.NRIC = Customer_Account_Table.NRIC
ORDER BY Customer_Table.Name;