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

using vb to select an item in a combo box. Possible?

Status
Not open for further replies.

Jerrycurl

Programmer
Aug 4, 1999
85
US
I have a form with a number of text boxes in it. I have a combo box that users use to select a person by last name. The combo box's rowsource is a query and it has 8 columns, but not all are visible. When a last name is chosen, the text boxes on the form are filled because their control source is something like this: =[LastNamebox].[Column](3). Here's my problem. I want to be able to add a new record to the form and fill in the text boxes and combo box automatically (because I will have obtained the name of the person I want displayed). I've reset the rowsource of the combo box to a query that returns only the row I'm interested in. I just can't seem to get the combo box to select that row. It seems like it would be simple if it were a list box. Am I overlooking something obvious, or is this really as tricky as it seems to me? Thanks for any help.
 
Maybe I've misread your post, but it sounds like you're trying to mimic user interaction (selecting an item from the dropdown list) for a process that requires no user interaction (adding a record to a table). If that's the case, you can bypass the form completely. One method would be to convert your select query to an append query.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top