Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Combo box controlling text box 4

Status
Not open for further replies.

Crystalguru

Technical User
Oct 4, 2001
303
US
This must be posted somewhere, but I cannot find it...
I would like my users to select from a combo box an associate's name (asc_lastname,asc_firstname). When the selection is made I would like the Unique Identifier(asc_uid in the Asc_profile table) for that associate to populate a text box. Then the user will click on a button to run a report that is linked to the asc_uid. I just cannot get the associate's name to control a text box! The user will not be able to modify these fields just choosing for a report.

Spent all morning on this little thing....
 
The record source for your combo box should include the ID field. You don't have to show it, just include it. Set it's WIDTH in the combo box property sheet to zero. (depending on whether it's column 1 or column 3, physically:

ColumnWidths: 0;1.5;1.5
or
ColumnWidths: 1.5;1.5;0

Then you can refer to it in the combo box's AFTER UPDATE processing by using it's column number. (Don't forget that combo box column numbers are zero based for this process.)
For example,
Code:
Sub MyCombo_AFTERUPDATE()
...
...
Me.AssociateID = Me.MyCombo.column(0)
...



Jim Hare
"Remember, you're unique - just like everonone else"
 
Jim
Here's the sql;
select name, asc_uid from asc_profile

I added the code:
Sub Combo0_AFTERUPDATE()
Me.textbox8 = Me.Combo0.column(2)
end sub

When I go to the combo box and select an associates name (last,first) then tab to the text box, nothing happens.. What did I forget to do?

Thanks,
crystalguru


 
Remember when I said:
...column number. (Don't forget that combo box column numbers are zero based for this process.)...


As written, your combo has NAME as Column(0) and ASC_UID as column(1)

Try this:
Code:
Sub Combo0_AFTERUPDATE()
    Me.textbox8 = Me.Combo0.column(
1
Code:
)
end sub

Jim Hare
"Remember, you're unique - just like everonone else"
 
Ah ha! I guess if I would of read your directions the first time, I would of got it.

Works great!

thank you for your time!
crystalguru.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top