How to check a field from a different table

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a fields SSN and Set in the table Provider.

I need to find what is in the Set field for the SSN field in the same table.
I am doing this on a different form called Main.
 
Assuming SSN is text and is a field on your form, set the control source
property of a textbox on your form to

=DLookUp("Set","Provider","SSN = '" & Me.SSN & "'")
 
How does Dlookup evalutate? If I do it this way is it a boolean or 1 or 0
for true or false?
 
Dennis, I've had some trouble with Dlookup before, can you explain to
me how it works? =) Thanks
 
Will this enable be to get information from the field 'Set' if so how do i
access this field?
 
The DLookup statement is saying in English, Get me the 'Set' field from the
table 'Provider' where the 'SSN' field in the table matches the SSN field I
have selected or entered into the SSN field on my form.
e.g.
Table Conversion
Set SSN
Test1 AB
Test2 CD
Test3 EF

A textbox on a form with the control source set to
=DLookUp("Set","Conversion","SSN = 'CD'")
will put Test2 into this textbox.
 
The DLookup statement is saying in English, Get me the 'Set' field from the
table 'Provider' where the 'SSN' field in the table matches the SSN field I
have selected or entered into the SSN field on my form.
e.g.
Table Conversion
Set SSN
Test1 AB
Test2 CD
Test3 EF

A textbox on a form with the control source set to
=DLookUp("Set","Conversion","SSN = 'CD'")
will put Test2 into this textbox.
 
Ah ha, now if you used this code on, say, a list box, how does this
control source differ from the row source?
 
Not sure, I've never used a DLookup on the control source of a listbox. The
row source of the list box determines what is in the list and the control
source is what is selected and what will be stored it it is bound to a table.
I suspect if you use a DLookup on the control source & it looks up a valid
item in the list then this item will be pre-selected and the list box will
become non-editable.
 

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

Back
Top