Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
|
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 22nd, 2006, 12:32 PM
Authorized User
 
Join Date: Sep 2006
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Default New VBA user has simple question

I have a combo box on a form. This combo box is repeated 4 times to give the user the option to select 4 different choices. Once the choice is made, I want a text box next to each combo box that displays the description field based on what the user selected. Can someone tell me how to write this simple code.

Thanks

Michele Haywood
__________________
Michele Haywood
 
Old September 25th, 2006, 02:25 PM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

The simplest way to do this is to use the combo box wizard to select the PK, the selection field, and the description field, then change the column display to 0";1";0". This will hide the PK and the description field.

On the combo box, after update event (help me guys) put this code:

Me.txtMyTextBox = Me.cboMyComboBox.Columns(2)

See if that works.



mmcdonal
 
Old September 26th, 2006, 03:52 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,151
Thanks: 2
Thanked 14 Times in 14 Posts
Send a message via ICQ to SerranoG Send a message via AIM to SerranoG
Default

Yes, that sounds correct, MMcDonal. You can also use a DLookUp to populate the textbox, but your way is faster resource-wise.


Greg Serrano
Michigan Dept. of Environmental Quality, Air Quality Division





Similar Threads
Thread Thread Starter Forum Replies Last Post
simple question petergoodman XSLT 8 July 18th, 2008 07:57 AM
very simple question rogdawg Visual Studio 2005 2 January 14th, 2008 04:03 PM
Simple Question ironchef Java GUI 0 September 14th, 2006 04:56 PM
A simple question about date in VBA for Excel 2002 Trancefuzion Excel VBA 2 July 29th, 2004 04:37 AM





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