473,499 Members | 1,483 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Autofill Text Boxes through List or Combo box HELP

1 New Member
Hi there, i'm quite a newbie at Access and i am currently stuck on a form problem. I am using a wizard of oz-style database and I want to autofill boxes through the selection in a combo box

I already have fields in my database including charactersname, characters gender, characteridnumber etc.. and i want to include the charactersname in the combo box, so that when selecting a name, the appropriate gender is also shown below that

In other words, if Dorothy was on the selection list/box, when selected, the gender field at the side would automatically turn to "Female", same goes for Tinman and Scarecrow being "Male"

Thank you very much :-)
May 8 '14 #1
5 1742
jimatqsi
1,271 Recognized Expert Top Contributor
sonickidj,
Welcome to Bytes.com.

Perhaps the easiest way to accomplish this is to make the rowsource of your combo box have multiple columns. You can make the display length of the "extra" columns zero so they won't show in the drop-down but the data will be along for the ride.

In the AfterUpdate event of the combo-box you can fill text boxes on the screen by referencing columns of the comobo box. Something like this:
Expand|Select|Wrap|Line Numbers
  1. me.Gender_txt = me.Character_cbo.Column(1)
  2. me.Age_txt = me.Character_cbo.Column(2) 
etc... Note that the first column of a combo-box is column(0).

There are other ways to accomplish what you want but this may be the simplest. You'll find the relevant settings in the Data tab and the Format tab of the combo-box properties.

Jim
May 8 '14 #2
jimatqsi
1,271 Recognized Expert Top Contributor
For my example to work, the Select query of the combo-box rowsource would have to include Gender and Age as the 2nd and 3rd fields selected. You have complete control over that when you build the query for the rowsource.

Jim
May 8 '14 #3
twinnyfo
3,653 Recognized Expert Moderator Specialist
Jim,

Just reviewing some of these old posts, and you taught me something today! I never realized you could read the values of the various columns of the Combo Box. I thought the Value was simply the default Column.

This gives me som ideas on how to use this new knowledge! Thanks for your post and sharing with us!
Jun 10 '14 #4
jimatqsi
1,271 Recognized Expert Top Contributor
So glad to post something helpful once in a while :) The combo box really is a flexible, useful object.

I've gained a strong appreciation for list boxes in recent years. I used to avoid them but now I find 101 uses for them. I've gotten more selective about when I use combo boxes.

Jim
Jun 10 '14 #5
twinnyfo
3,653 Recognized Expert Moderator Specialist
I know this may be a bit off topic from the OP, but what advantages have you found for using a list box over a combo box? I like how compact a combo box is compared to a list box--although acombo box requires two clicks instead of one in some cases. I'd be interested to know your thoughts. I am always eager to explore new/better ways of doing things.
Jun 11 '14 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

0
2193
by: Jim | last post by:
Hi, there, I am a beginner on Access. I have been taking so long time to try to figure out his, but so far, no clues. I want to select 2 combo boxes and Access will automatically fill in...
4
12815
by: godber | last post by:
I need to populate text boxes for instance with employee information using their unique employee works number selected from a combo box. Can anyone help, I am told thru visual basic this can be...
4
1754
by: Mark L. Breen | last post by:
Hello Guys and Galls, I use combos on my forms. The code to initialise the combos is as follows Dim dsPIDTypes As DataSet dsPIDTypes = PartDB.GetPIDTypes ' Returns a dataset object...
13
3368
subashini Thiyagarajan
by: subashini Thiyagarajan | last post by:
Hi, I am inserting a record in Access table using ASP,it is working fine.i have so many text boxes,list boxes to get the input fields. Actually for all the insert cases i don't require all the...
1
1512
by: tomlebold | last post by:
Should text boxes or combo boxes be renamed on bound forms? In other word should the Department Name property be the same as Control Source property? I never rename them, but my IT manager seems...
2
3609
by: jw01 | last post by:
I have a form in which there is one combo box and three text boxes: Combo Box: -> Item A -> Item B -> Item C TextBox1: TextBox2: ...
9
4974
by: Marianne160 | last post by:
Hi, I know there are various answers to this problem available on the web but none of them seem to work for me. I am using Access 2003 to make a form to look up data from a table. I have so far...
1
1722
by: Hiker68 | last post by:
Hello, I am very new at Access & VBA so I hope you understand what I am asking. I have a form that displays information about an apartment building. I created a combo box to list all of the...
0
1465
by: Marie Gardner | last post by:
Hi, I want to create a form that filters a report that is between a date range, and includes only the data for the item selected in the combo box. For example, I am creating a time manager...
1
2387
by: Marie Gardner | last post by:
Hi, I want to create a form that filters a report that is between a date range, and includes only the data for the item selected in the combo box. For example, I am creating a time manager...
0
7006
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7169
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
6892
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7385
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5467
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4917
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3096
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3088
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
661
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.