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

Wrong selection in combobox

Status
Not open for further replies.

Rich196

Programmer
May 17, 2003
42
US

I have a form1 and form2. On form1 there is a grid populated by a view from which I allow a dblclick on lastname. I position the table containing the lastname and set up a parm to be passed to a combobox on form2. In the INIT event of form2 I put the lastname in the value property of the combobox and requery the view for a grid that shows the events attended by the person and the rest of the text boxes are updated upon refresh. All works as planned.

The problem is that since the combobox value is only the lastname and there are duplicate lastnames, when the combobox is opened the selected entry is the first name in the table that matches. I need for the selected entry to be the one currently in the combobox so that the InteractiveChangeEvent will be able to fire when another choice is made. I think I need to somehow also pass the attendeeID of the person that was collected on form1.

The combobox is RowSource = attendees.lastname,firstname
RowSourceType = 6
ControlSource = attendees.lastname
BoundColumn = 1
BoundTo = .f.

I hope this is clear enough.
Any suggestions on how to accomplish this would be greatly appreciated.

Rich
 
Rich,
Try:
Code:
RowSource = attendees.lastname,firstname[red][b],attendeeID[/b][/red]
RowSourceType = 6
ControlSource = [red][b]attendees.attendeeID[/b][/red]
BoundColumn = [red][b]3[/b][/red]
[red][b]ColumnCount=2 && for display purposes[/b][/red]
Rick
 
Thanks Rick,

It worked. I forgot to change the BoundColumn when I tried it.

Rich
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top