lookup Record

A

alex

using Access '03...

Let's say on a form you have many text boxes bound to a table. Is
there a way to modify one of those text boxes to also function as a
lookup (like using the textbox containing the primary key)? Can you
do this and still allow data entry on the form?

E.g., one of the controls has a drop down arrow with all of the
records for that "column"; choose one and everything switches to that
record.

I've used unbound combo boxes to do this...but it seems that may be
duplicating what a text box could already do.

alex
 
D

Douglas J. Steele

You don't really want a bound combo box. If you were to choose a new value
from the combo box, it would change the value in the field to which the
combo box is bound.

For navigation, you really want unbound combo boxes.
 
W

Wayne-I-M

Say you have a table (tblClient) with some fields (ClientID,1stName, 2ndName,
etc)

You can use the afterupdate event of the control on the form bound the
surname field (txt2ndName) to check if this person may have a record

If ((DLookup("[ClientID]", "[tblClients]", "[1stName] ='" &
Form!txt1stName & "' AND [2ndName] = '" & Form!txt2ndName & "'"))) Then
Beep
MsgBox "This person may have a record", vbOKOnly, "Some Name"
End If

Stuff like this will work fine - but your idea of using an unbound combo or
text box is a better one than using the control to search as well.

Of course it could work but then if you input John into the 1st name you
will be prompted to go to all the John records - hope that makes sense.

Users like to have a "search option" so it may be a good idea to keep it
seperate -

Of course this is just my idea and some people may like combining input
control as search"ers"

:)
 
A

alex

You don't really want a bound combo box. If you were to choose a new value
from the combo box, it would change the value in the field to which the
combo box is bound.

For navigation, you really want unbound combo boxes.

--
Doug Steele, Microsoft Access MVPhttp://I.Am/DougSteele
(no private e-mails, please)










- Show quoted text -

Thanks Doug...I'll stick to unbound.
 

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

Similar Threads


Top