update form from listbox help

  • Thread starter Thread starter Curt
  • Start date Start date
C

Curt

I posted yesterday about a problem I have been working
on. However, I am still not able to get this to work. I
have searched on knowledge base and through help. Here is
my delima.

I have a form with a query as the recordsource. In this
query I have a concatenated field which is the primary
field. This form has a subform which is related to the
form linking to this field. This all works fine, but I
thought I would throw that in just in case the answer to
my question might cause other problems.
Anyway I have an unbound listbox on my main form. This
list box is updated when I select items from the main form
and the subform. This list box also has the field from
the concatenated field(hidden). What I am trying to do is
select a row (person with items related to that person)
from the listbox to bring up their record on the main
form, in case users need to update their record. How do I
go about doing this? I have looked up bookmarks and
recordsetclones, but I still have not got anything to work
for the past 2 days since I am selecting a string.

I have researched applyfilter and each method I try I
either get the form being blank, or not filled at all, or
an error message.

Any help with this would be appreciated.
 
Never mind I finally figured it out.

For future use in case need the same type of procedure
here it is.
Private Sub Listbx_AfterUpdate()
Dim rst as Object
If Listbx.ListIndex < 0 then
else
Set rst = Me.Recordset.Clone
If Not rst.EOF then Me.Bookmark = rst.Bookmark
End if
 
Sorry about the last post I left off part of it.

Private Sub Listbx_AfterUpdate()
Dim rst as Object
If Listbx.ListIndex < 0 Then
Else
Set rst = Me.Recordset.Clone
rst.FindFirst "[ID] = '" & Me![Listbx] & "'"
If Not rst.EOF Then Me.Bookmark = rst.Bookmark
End If
End Sub
 
Back
Top