i have a combobox and i want to run code the MOMENT a user clicks on it.
here's the situation.
i've got a table which has a field called MachinePK. this is the foreign key of the field PK in the Machine table.
so when i have a form which shows this table, instead of showing the MachineName, it is showing the MachinePK in the bound textbox.
i want to show the Machine Name.
so what i did was that i put a combobox there with the bound column as MachinePK but the second column as MachineName. the rowsource is the Machine table. the first column is hidden whilst the second is shown. so the effect is the user sees the MachineName instead of MachinePK.
now i want to run some code when the user clicks on the combobox. so i write code for the onclick event. however i tested it and realised that the click event does NOT fire off until the user clicks on the combobox and then selects a value from the dropdown list.
this is a problem. because the user can just click INSIDE the combobox (not on the dropdown arrow) and then edit the combobox using the keyboard. of course i can use a onkeydown event etc but i want the effect of a textbox onclick event
how can i do this guys?
i thought of disabling the textbox but then i realised that the onclick event wouldn't fire.
P.S. i know yall would probably say that i should have a join query to convert MachinePK to MachineName first. the reason why i didn't do that is because back then, i thought using a join query will make the query uneditable. but i just tested and i realised that the join query is still editable. but i still want to learn how to simulate the textbox onclick style event with a combobox - so that i explore Access more and learn more.