M
MikeBres
Hi folks,
I'm trying to make a form that selects from a listbox and
displays the selections in another listbox. I am setting
a value on the InUse field, then trying to requery the
new list so that it shows all the records with the InUse
field set to True. What happens is: I select the
record, click on the command button, and nothing is added
to the new listbox until I go to a new record and click
the command button again. Then the previous record is
added to the new listbox.
Can anybody tell what I am doing wrong? Here is my code.
The table has three fields, ZIPRange, Destination, &
InUse. 'List0' has the complete table of destinations
listed and 'List2' displays the destinations with only
InUse set to True.
Private Sub Command6_Click()
Dim rst As DAO.Recordset
Set rst = Me.RecordsetClone
rst.findfirst "[Destination] = """ & Me.List0 & """"
Me.Bookmark = rst.Bookmark
rst.Edit
Me.InUse = True
rst.Update
rst.Close
Me.List2.Requery
End Sub
I'm trying to make a form that selects from a listbox and
displays the selections in another listbox. I am setting
a value on the InUse field, then trying to requery the
new list so that it shows all the records with the InUse
field set to True. What happens is: I select the
record, click on the command button, and nothing is added
to the new listbox until I go to a new record and click
the command button again. Then the previous record is
added to the new listbox.
Can anybody tell what I am doing wrong? Here is my code.
The table has three fields, ZIPRange, Destination, &
InUse. 'List0' has the complete table of destinations
listed and 'List2' displays the destinations with only
InUse set to True.
Private Sub Command6_Click()
Dim rst As DAO.Recordset
Set rst = Me.RecordsetClone
rst.findfirst "[Destination] = """ & Me.List0 & """"
Me.Bookmark = rst.Bookmark
rst.Edit
Me.InUse = True
rst.Update
rst.Close
Me.List2.Requery
End Sub