Wrox Programmer Forums
|
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 19th, 2006, 01:55 AM
Authorized User
 
Join Date: Nov 2005
Posts: 27
Thanks: 0
Thanked 0 Times in 0 Posts
Default combo code

I would like to know a VBA code that I can use in combo operation as follows. I have a table from which the combo looks up employee IDs but the same table has other data such as employee name, address and salary scale. Now I want such that when I select an ID it should also transfer and display the other values for that particular ID such as name, salary scale etc

Bright

Bmulenga
__________________
Bmulenga
 
Old September 19th, 2006, 03:14 AM
Authorized User
 
Join Date: May 2006
Posts: 47
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to Ashfaque
Default

If your combo contains and displaying columns like Id, EmpName, BasicSalary and so on then you could write following.

Let us say you have placed 3 text boxes named EmpId, EmpName and EmpBasicSalary on a form along with the combo.

On the AfterUpdate event of Combo, write the following code

Me.EmpId= me.Combo.Column(0)
Me.EmpName= me.Combo.Column(1)
Me.EmpBasicSalary= me.Combo.Column(2)

The sequence of column in the combo always begin with 0. Means Id will have Zero position and EmpName column will have 1st position and so on.

Hope this help

With kind regards,
Ashfaque








Similar Threads
Thread Thread Starter Forum Replies Last Post
Combo box to display items from parent combo box Gini Visual Studio 2008 0 June 18th, 2008 12:30 AM
Combo box choice creating filtered combo box stevensj5 Access 11 September 13th, 2007 11:33 AM
combo box ajabbabahalmigiriha C# 4 August 21st, 2007 09:57 AM
Combo shan_cool PHP How-To 2 April 6th, 2006 12:43 AM
Using Combo Box Rudner Access VBA 1 November 4th, 2004 08:58 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.