Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Sam Sam is offline
external usenet poster
 
Posts: 699
Default 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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 897
Default 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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Populate Userform Listbox with Access values [email protected] Excel Programming 5 April 5th 07 07:46 PM
Populate userform listbox from access db Nancy Moon Excel Programming 0 March 1st 06 09:20 PM
Variable input to populate data fields csinvestor Excel Discussion (Misc queries) 3 September 9th 05 09:00 AM
Range of Cells to populate in a text box on a userform BenjiHarshbarge Excel Programming 1 November 4th 03 10:09 PM
Populate Userform text boxes in VBA with VLookup data from #2 worksheet Laz[_2_] Excel Programming 4 October 8th 03 02:15 AM


All times are GMT +1. The time now is 06:21 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"