
Setting Initial Values In A Combo Box
Guy,
I take it that your combo box is not bound and that you are using it to
control as sort of a filter control for already existing records. What you
need to do is set the default value property of the combo box to the value
that you would like. Then you will have call the function or sub that you
are using to sync your subform on the onload event of your form. That
should do it. I hope it helps.
If you want to do it all using code then try this in your form class module
Sample Code
Private Sub Form_Load()
Me.cboCompanyName = "Your Company"
If Not FuncSyncSubform Then
MsgBox "Unable to sysnc the sub form", vbInformation
End If
End Sub
Private Function FunSyncSubform() as Boolean
Your sync code That returns true if successful sync and false if
not.
Exit Function
Alan
Quote:
>I am currently using a combo box in a form to select records displayed in a
>subform.
>i.e to display all records for a particular company
>The combo box is populated with values from the companies table
>On opening the form there is no value shown in the combo box.
>I would like to be able to do both of the following:
>1. Have the first value in the list displayed in the box; or
>2. Specify the list item (ie ComNum5) and have it displayed in the box on
>opening the form
>Any thoughts for a good solution?
>Guy