B
Bob Paup
In access 2003 I used a combo box to go to the record but it just goes to the
table and adds a record.
table and adds a record.
In access 2003 I used a combo box to go to the record but it just goes to the
table and adds a record.
I created a form that has two combo boxes. One searches for the LName in the
table LName and the other looks up the value of Status in the same table in
the record identified the the search for LName.
This is the code that executes After Update in the search for Combo 4:
Private Sub Combo4_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[LName] = '" & Me![Combo4] & "'"
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub
This is the code that executes after update in the of the status for combo 8:
Private Sub Combo8_AfterUpdate()
Me.Combo8.DefaultValue = Chr(34) & Me.Combo8 & Chr(34)
End Sub
John W. Vinson said:I created a form that has two combo boxes. One searches for the LName in the
table LName and the other looks up the value of Status in the same table in
the record identified the the search for LName.
This is the code that executes After Update in the search for Combo 4:
Private Sub Combo4_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[LName] = '" & Me![Combo4] & "'"
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub
This is the code that executes after update in the of the status for combo 8:
Private Sub Combo8_AfterUpdate()
Me.Combo8.DefaultValue = Chr(34) & Me.Combo8 & Chr(34)
End Sub
The second sub just sets its own defaultvalue property (so that when you move
to the new record that record will default to the most-recently-picked status
in another record).
If that's not what you want to happen please explain.
I am trying to display the current "status" and possibly change this value
in the record that the first sub finds. The result of this code is that a
new record is created with "LName" and "Status". The search for the record
that contains "LName" does not work.
John
Thanks that makes it work. Now I want the combobox to not retain the value
that I entered after it gets used. In otherwords be null when it is complete.