HELP: Populate corresponding userform text fields from access data

S

sam

Hi all,

I have about 7 textbox fields on a userform I created(eg: Emp_Id, Last_name,
First_name, Phone, Street, City, St). All this data is stored in an Access
Database.

Is it possible to populate: Last_name, First_name, Phone, Street, City and
St from access database based on what I input in Emp_Id?

Thanks in Advance
 
J

JP

There's some sample code here you could adapt:

http://support.microsoft.com/kb/146406

Just comment out this line:

Set Rs = Db.OpenRecordset("Customers")

and un-comment:

'Set Rs = _
'Db.OpenRecordset("SELECT * FROM Customers WHERE Country = 'UK';")

Update the SQL statement to filter based on your Emp_Id textbox. For
example,

"SELECT * FROM Customers WHERE Emp_Id = '" & Emp_Id.Value & "';"

--JP
 

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