If FIELD1 = "string1" then FIELD_ID1 = 1

carpet

New member
Local time
Yesterday, 22:58
Joined
Sep 17, 2009
Messages
9
I'm an access toedipper and I want to be able to designate a specific ID number to a user populated field. I'm sure I could do this in excel but it seems trickier in access so I may be approaching it from the wrong angle.

To clarify, as a user populates a form I want to then be able to run some code that looks at the information they've inserted and then assign a unique ID code from a list I've created.

Hope that makes sense. Hope someone can help.

Cheers.
 
You're right, you're taking the wrong approach.

Keep your unique ID codes and associated text in a table. Allow the user to enter the data in a combo-box. If for some reason the value they type is not already in the table, you can write code against the combo-box (the "On Not In List" event) to insert it into your look-up table.

When using Access, one of the last things you should think about is writing code...it really doesn't require much code because most of the code is already written and (best of all) tested by Microsoft.
 
Thanks so much for the info. Do you happen to know if there's a way to automate that process such that the user just inserts the string into the field and access autogenerates the ID from the table? It's cause the field/Id table will have about 150 entries and the user will need to insert up to 22 options from the list into the form. Automation would be ace!
 

Users who are viewing this thread

Back
Top Bottom