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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Get value from combobox

Status
Not open for further replies.

OrlandoG7

Technical User
Jan 1, 2002
33
US
I have a combobox tied to 2 fields on one table. the row source is: SELECT [tblBoats].[ID], [tblBoats].[BoatName] FROM tblBoats;

When selecting a boatname from the combobox, I want the name of the boat to appear in a textbox on the same form.

Private Sub Command16_Click()
Form_frmNewCrs.CruiseRemarks.value = Form_frmNewCrs.BoatName.Value
End Sub

Why won't this work? I get this error:
"Object or class does not support this set of events"

Both controls are text type.
 
Try this syntax:

Private Sub Command16_Click()
Me("CruiseRemarks") = Me("BoatName")'.Column(1)
End Sub

Uncomment .Column(1) if you want the second column to be displayed in the text box.

Regards,

Dan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top