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!

Automatic Record selection if only one available record

Status
Not open for further replies.

kkkk3345

Technical User
Apr 18, 2006
2
US
There are 3 combo box in a form. When the user selects anything from the first combo box then combo box 2 and 3 would display only relevant records based on his selection on first box. (Thankfuly I got this part working!)

Now I wish to autoupdate combo box 3 if there is only one record option for the user to choose based on this selection of previous 2 combo box.

Thanks
Padi
 
kkkk3345,

I presume you are requerying the 3rd combo in the AfterUpdate event of the 2nd combo, right? After the requery, you can use the ListCount property of the 3rd combo to determine the number of rows, then if only one, automatically select the only row. Here's some air code that might get you started:
Code:
If Me!cboMyCombo.ListCount = 1 Then
     Me!cboMyCombo = Me!cboMyCombo.ItemData(0)
End If
HTH,

Ken S.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top