ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   HELP: Populate corresponding userform text fields from access data (https://www.excelbanter.com/excel-programming/434536-help-populate-corresponding-userform-text-fields-access-data.html)

Sam

HELP: Populate corresponding userform text fields from access data
 
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

JP[_4_]

HELP: Populate corresponding userform text fields from accessdata
 
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

On Oct 5, 2:46*pm, sam wrote:
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



All times are GMT +1. The time now is 06:40 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com