Getting values from the table or other forms

afnan_88

Registered User.
Local time
Yesterday, 21:46
Joined
Jun 16, 2010
Messages
27
hi ,

i hope you're fine..
& i hope you can help me

here is my small issue :
i have many forms for one table
in some forms i need the value of a control in other forms
or i need the value from the table for the current record

i want a value of some field called "family type" its type text
located in the table" IA" for the record that i'm filling now ..

is it a solution to make the control that i need Public ..but i think that isn't suitable :(

im trying to use the DLookup() here is my try:

1st try>>>to get it from the form

Dim varX As Variant

varX = DLookup("[family type]", "IA", "[National ID] = & Forms!INITIAL_ASSESSMENT!National_ID")

2nd try >>to get it from the table

Dim varX As Variant

varX = DLookup("[family type]", "IA", "[National ID] = ' " & [National_ID]& "'")


i get an error that the filed i'm seaching for is not found
can you tell me whats wrong with the func


thanx in advance:)
 
You have misplaced some of the quotes.
Code:
Dim varX As Variant

varX = DLookup("[family type]", "IA", "[National ID] = [COLOR="Red"]"[/COLOR] & Forms!INITIAL_ASSESSMENT!National_ID)
and your second try:
Code:
Dim varX As Variant

varX = DLookup("[family type]", "IA", "[National ID] = " & [National_ID])

Enjoy!
 

Users who are viewing this thread

Back
Top Bottom