Link to home
Start Free TrialLog in
Avatar of VilkoP
VilkoP

asked on

Insert two values via dropdown box (on Not in list)

HI,
I have a MS access database and one of the fields on the form (suburb_name) is a dropdown box that looks at the SUBURB table and returns the list of sall active suburbs (other colums in the same table are: id, postcode, state and status).

What I would like to achieve is to alllow users to pick suburb from the dropdown list and if the value desn't exist to be able to add it tot the source table. I have two problems:
1) How to prompt user to enter subub name and postcode one after another and to inseret them in to the SUBURB table.
2) Second problem is to populate onother text field (post_code) on the same form with the postcode value from the SUBURB table where the value from the above mantioned dropdown box on the form is the same as in the SUBURB table.
Example: dropdown box for SUburb ihas values of  A, B, C, D. If I pick A I want another field to show value of 1)
Thanks vilkop
Avatar of Arthur_Wood
Arthur_Wood
Flag of United States of America image

In order to trigger the NotInList event, the user has already entered the Name of the suburb that is 'not in the list', and that entered value is passed as an argument to the NotInList event handsler, so there is no need to ask the user to enter that value again.  But in order to get the PostCode as well, you can preset anerth user-defined firm, to have the user enter the postcode, and there you would validate the entry, to make sure it is ion the proper form.  When the user closes this PostCode form, then you add the new record to the SUBURB table (suburb_name, postcode, status and status) and set the return code (so the combo-box will be re-queried) and ent the NotInList event handler.  At the same time, you can show the post-code that was entered in the text box.

AW
Avatar of VilkoP
VilkoP

ASKER

Hi Arthur,

Thanks for the information, I am however unsure about few things you said:
"you can preset anerth user-defined firm, to have the user enter the postcode"
(when not in list tit adds it to the table (works fine) how to trigger the other value to be entered ?)
I have created a separate form for postcode, but its source is a table too, should it be free from that link,
how do I write to the same row as initially entered suburb name..something like vhere value = form.filed.value ?
How would you do the return code ?
Thanks in advance. vilkop
ASKER CERTIFIED SOLUTION
Avatar of Arthur_Wood
Arthur_Wood
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial