Then, as Dennis mentioned, your combo box should be unbound (nothing
in it's control source). It would typically be placed in the header of the
form, and it should also have properties like the following;
Row Source - "Select OrganizationID, OrganizationName From tblOrganizations
OrderBy OrganizationName"
Bound Column - 1
Column Count - 2
Column Widths - 0",2" (or whatever works best for the second column)
This way, the organization ID will be in the combo box so you can search
on it, but it will not be displayed to the users. The code Dennis provided
should work, but if the OrganizationID in an integer (number), then you will
want
to remove the single quotes like;
Set rs = Me.Recordset.Clone
rs.FindFirst "[OrganizationID] = " & Me![OrganizationID]
If Not rs.NoMatch Then
Me.Bookmark = rs.Bookmark
End If
--
_________
Sean Bailey
FA said:
I want to search for particular records.
:
What are you trying to do? Are you just trying to search for a particular
record, are do you want to actually manipulate (change) data in the
underlying table?
--
_________
Sean Bailey
:
This is what I have:
Private Sub Nombre_de_organización_AfterUpdate()
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[Nombre de organización] = '" & Me![Nombre de organización] &
"'"
Me.Bookmark = rs.Bookmark
End Sub
The comboField appears to have the same name as the Table field (I think it
was created automatically when I change the text box to a combo box field).
What I'm doing wrong?
:
Its the actual Name of the combo box field on your form
:
What should I write on the [ComboField]?
:
Sorry, yes the After_Update event
:
In the after update event?
:
Dim rs As Object
Set rs = Me.Recordset.Clone
' if a text field use this
rs.FindFirst "[YourTableFieldName] = '" & Me![ComboField] & "'"
' if a numeric field use this
rs.FindFirst "[YourTableFieldName] = " & Me![ComboField]
Me.Bookmark = rs.Bookmark
:
I made a form using the wizard and as usual everything was entered as text
boxes. I want to change one of them to a combo box. I used the 'right
click'-'change to' feature
I populated the list with a select query on the row source property. My
problem is that the record on the form does not change. How
can I make this combo box to select the record on the form?
Thanks,
FA