Auto Populating Fields (1 Viewer)

custhasno

New member
Local time
Today, 18:29
Joined
Sep 7, 2011
Messages
4
Hi,

I have a noob question that i hope someone can help with. I am creating an access database (2010) for a horse registration society. To take both information on registering members (contact info and ID) and any horses they also register. So single owners may have many horses registered. There are unique ID's for both horses and members. I have two tables, 1 for horses and one for members/owners.

When creating the form for registering a new horse, I would like to add a feature where by typing in the ID of the member, birngs up the members name, so the inputter knows they have the correct member before adding the horse (every member is already sotred in another table with unique ID's but ihave not got a clue how to link these together at Form level).

Even some pointers as to the name of what this feautres is or where to find it on MS forums or other guides would be a great help.

Thanks
 

CBrighton

Surfing while working...
Local time
Today, 18:29
Joined
Nov 9, 2010
Messages
1,012
Something like this in the after update event of the ID control should do the job:

Code:
txtMemberName = DLookUp("MemberName","tblMembers","MemberID = " & txtMemberID)

Replace the guessed field / table / control names with the real ones.

DLookup("FieldName" , "TableName" , "Criteria")
 

custhasno

New member
Local time
Today, 18:29
Joined
Sep 7, 2011
Messages
4
thanks, lots for me to educate myself on there, Dlookup seems to be the place to start cheers
 

tobyjenkins

Registered User.
Local time
Today, 18:29
Joined
Sep 8, 2011
Messages
13
Or you could use a dropdown/combobox where the users can type in the name of the client rather than their ID number - might this me a more user-friendly approach?
 

CBrighton

Surfing while working...
Local time
Today, 18:29
Joined
Nov 9, 2010
Messages
1,012
Or you could use a dropdown/combobox where the users can type in the name of the client rather than their ID number - might this me a more user-friendly approach?

Depends.

I can type my 7 digit ID number on a numpad far quicker than I can type my name.

Of course, in my databases I have a function to pull the signon used to log into windows which contains the 7 digit ID, so in my case it's instantly getting the ID & looking up the name or asking the user to manually enter the name.
 

Users who are viewing this thread

Top Bottom