GoToRecord from listbox

  • Thread starter Thread starter mcwhirt3
  • Start date Start date
M

mcwhirt3

Hello,

I have a listbox on form frm_items with 3 columns:

1)name
2)PLU
3)Date Updated

I have another form (frm_data_entry) where data entry happens into
these 3 fields which in turn populates the listbox with entries. I need
to reverse the proccess somewhat now. How can i use the listbox as a
lookup source which then jumps frm_data_entry to that same record? I
basically want to select a record from this listbox and then see that
same entry in a different form after clicking a commandbutton. I've
tried "docmd.gotorecord", and "docmd.openform"'s where clause and i
can't seem to get anything to work. Thanks for any advice.
 
I have a listbox on form frm_items with 3 columns:

1)name
2)PLU
3)Date Updated

I have another form (frm_data_entry) where data entry happens into
these 3 fields which in turn populates the listbox with entries. I need
to reverse the proccess somewhat now. How can i use the listbox as a
lookup source which then jumps frm_data_entry to that same record? I
basically want to select a record from this listbox and then see that
same entry in a different form after clicking a commandbutton. I've
tried "docmd.gotorecord", and "docmd.openform"'s where clause and i
can't seem to get anything to work.

You forgot to tell us how to identify the record in the
form's record source.

In the interests of providing some example code, I will
assume that the PLU field is the record's primary key and
that it is a numeric type field. In that case the code
would be something like:

With Forms!frm_data_entry.RecordsetClone
.FindFirst "PLU = " & Me.thelistbox.Column(1)
If Not .NoMatch Then
Forms!frm_data_entry.Bookmark = .Bookmark
End If
End With
 
Back
Top