Dlookup and then add more information on the same form

L

learning_codes

Hi,

I'm still learning how to update additional information on the same
table (tbl_Players). I have the list of Team and City but no
information on Location, Phone Number and Age. I have the form
connect to tbl_Players. Everytime I look for the Team and City, it
will need to input Location, Phone Number and Age on the same table.

tbl_Players:

--- FieldName: Team (PK)
--- FieldName: City (PK)
--- FieldName: Location
--- FieldName: Phone Number

On the form:

Dlookup: Team (unbound box)
Dlookup: City (unbound box)
Location (box)
Phone Number (box)


Event Procedure:

CHECK_Team = DLookup("[Team]", "Tbl_Players", "[Team] Like ""*" &
Search_Team & "*"" And [City] Like ""*" & Search_City & "*""")

CHECK_City = DLookup("[City]", "Tbl_Players", "[Team] Like ""*" &
Search_AccessCode & "*"" And [City] Like ""*" & Search_City & "*""")

Me.Location = Me.Input.Location.Value
Me.PhoneNumber = Me.Input.PhoneNumber.Value


I'm not sure if I did that right thing. I want to use the same form
to look up (Dlookup) first and then add the information as below
within the selection of the DLookup. I have 50 Teams and each has
different location and phone number.

Your help would be much appreciated.
Thanks
 
J

Jeanette Cunningham

Hi,
not sure if I understand your question?
I see you have unbound boxes on your form. If you have all the boxes bound
to their matching field from the table, you will just be able to type the
values straight into the boxes without doing any DLookups. This will be much
simpler and it is the way Access is meant to work.
Download a couple of Access database templates from microsoft.com and have a
look at how they set up their forms for typing data into text boxes without
using DLookup.

Jeanette Cunningham
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top