display something based on combo box (1 Viewer)

RpbertS

Registered User.
Local time
Today, 10:21
Joined
Feb 14, 2000
Messages
93
hi okay,

I have a form that has a combo box on it and a text box. When I select the a value you in the combo box I'd like the matching information to appear in the text box.

The combo box is getting its data from one table that has only 2 fields in it.

Report Name and Report Description

simpley put, when I select a record name i want the description also.

thanks,
Rpb
 

simongallop

Registered User.
Local time
Today, 10:21
Joined
Oct 17, 2000
Messages
611
I am presuming that the combo box is showing the first column of data and that you want the second column shown in the text box.

Use the Event:On Change part of the combo properties and create the following code.

The column count is 1 as Column(0) is the first column (offset theory).

Private Sub cmbTEST_Change()
Me![txtTest] = Me![cmbTEST].Column(1)
End Sub

Any probs then email me at shg@bts.co.uk but be warned that I go home in an hour (17:30 BST, 16:30 GMT) and won't be back till Monday

HTH

Simon
 

RpbertS

Registered User.
Local time
Today, 10:21
Joined
Feb 14, 2000
Messages
93
worked great thanks
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 05:21
Joined
Feb 19, 2002
Messages
43,223
The Change event runs after each character is typed. You really should use the combobox's AfterUpdate event.
 

Users who are viewing this thread

Top Bottom