Hiiii All
I have a Form with Sub form , I add some data to sub form and then need to requery a listbox in Main form.
i try :
SerNo a combobox in my sub form) and a second Primary key in my table (show the attached photo please).
SerNo : is unique for this Order.
Problem is that this returns me to first record in the subform, while I want to stay on the current record.
thanks .
I have a Form with Sub form , I add some data to sub form and then need to requery a listbox in Main form.
i try :
Code:
Dim lngPK As Long 'change data type if yours is different
'set variable to current record ID
lngPK = Me.SerNo
Me.Parent.ListOne.Requery
'Me.Requery
'return form to original record
With Me.RecordsetClone
.FindFirst "SerNo = " & lngPK
If .NoMatch Then 'just in case another user deleted it in the interim
MsgBox "Record not found!", vbCritical
Else 'go to that record
Me.Bookmark = .Bookmark
End If
End With
SerNo : is unique for this Order.
Problem is that this returns me to first record in the subform, while I want to stay on the current record.
thanks .