C
Chris
Hi all. Please help!
My form allows add, delete, edit but not data entry. I use this form to
view and edit vacations and I wish to also be able to add a new vacation(s)
via a command button.
So...I call up the form, view existing vacations and click the button (data
entry = true) and make my entry ok.
Now, after adding record(s), I want to view all the records for this
employee with the new addition included.
My code:
Dim frm As Form
Set frm = Forms![3frmCaregiverVacations]
If Me.Dirty = True Then Me.Dirty = False
PostTest
Me.DataEntry = False
frm.Requery
With frm.RecordsetClone
.FindFirst "[CGID] = """ & Me![CGID] & """"
If Not .NoMatch Then frm.Bookmark = .Bookmark
End With
Set frm = Nothing
This code returns to viewing, displaying all records for all employees. I'm
guessing it is my .FindFirst line and the ID.
If I close the form and reopen it, all is good. The user may wish to add
several vacations for this one employee.
Where is my error in code? Logic? CGID is text type.
Thanks so much,
My form allows add, delete, edit but not data entry. I use this form to
view and edit vacations and I wish to also be able to add a new vacation(s)
via a command button.
So...I call up the form, view existing vacations and click the button (data
entry = true) and make my entry ok.
Now, after adding record(s), I want to view all the records for this
employee with the new addition included.
My code:
Dim frm As Form
Set frm = Forms![3frmCaregiverVacations]
If Me.Dirty = True Then Me.Dirty = False
PostTest
Me.DataEntry = False
frm.Requery
With frm.RecordsetClone
.FindFirst "[CGID] = """ & Me![CGID] & """"
If Not .NoMatch Then frm.Bookmark = .Bookmark
End With
Set frm = Nothing
This code returns to viewing, displaying all records for all employees. I'm
guessing it is my .FindFirst line and the ID.
If I close the form and reopen it, all is good. The user may wish to add
several vacations for this one employee.
Where is my error in code? Logic? CGID is text type.
Thanks so much,