MS Access 2003 retreieve value from table

Hi Guys
What is the fastest way to retrieve the value of the Customer-id from the first recor of .Customers' table
Something similiar to FoxPro's:
USE custmers
varCust-id=Customer-id
Thanks
Dory
dory550Asked:
Who is Participating?
 
Gustav BrockCIOCommented:
varCust-id = DLookup("Customer-id", "custmers")

/gustav
0
 
dory550Author Commented:

cactus_data:

Thanks  
That was short and sweet
I need another small advice pertaining to the same thread
Suppose I have a second table called 'Customers2'
I need to exract a shipping address from 'customers2' using the  varCust-id (outputed  above)
I can use:
varCo_Name=dlookup("[co_name]","customers2","cust_id='" & varCust-id & "'" )
varAddress1=dlookup("[Address1]","customers2","cust_id='" & varCust-id & "'" )
varCity=dlookup("[City]","customers2","cust_id='" & varCust-id & "'" )
And so on.......
My question is:
Is this an acceptable way for extracting shipping info in this senario?
How would you reccomend I do it?
Thanks
Dory
0
 
Gustav BrockCIOCommented:
It could be but most would open a DAO recordset and read from the fields.

Look up the on-line help on this. This is basic info you will need to be familiar with if you wish to move on with Access.

/gustav
0
 
dory550Author Commented:

cactus_data:

Thanks
Dory
0
 
Gustav BrockCIOCommented:
You are welcome!

/gustav
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.