J
JamesJ
I'm using the following code to return the number of records on a split form
in a unbound text box named txtCount:
Private Sub Form_Current()
If Me.NewRecord Then
txtCount = "0 Item(s)"
Else
txtCount = Me.RecordsetClone.RecordCount & " Item(s)"
End If
End Sub
Everthing seems to work properly with the text box returning the propr
number of records.
But when I open a form based on the same table using the following code by
clicking on the ID field:
Private Sub ContactID_Click()
If Not IsNull(Me.ContactID) Then
DoCmd.OpenForm "frmContactsEdit", OpenArgs:=Me.ContactID
Else
DoCmd.OpenForm "frmContactsEdit", , , , acFormAdd 'Open the
form on a new record
End If
End Sub
After I close frmContactsEdit txtCount the underlying form shows only 1
record even though
all records are being displayed. I know this has something to do with the
fact that I am in reality
filtering frmContactsEdit to the one record.
I have Forms!frmContacts.Requery in the OnClose of frmContactsEdit to save
any changes to records.
When I remark out the requery it's fine.
So, I need to find another way to open frmContactsEdit to the desired record
a different way or find
another way to reflect any changes I made to a record in frmContactsEdit.
Any help will be appreciated,
James
in a unbound text box named txtCount:
Private Sub Form_Current()
If Me.NewRecord Then
txtCount = "0 Item(s)"
Else
txtCount = Me.RecordsetClone.RecordCount & " Item(s)"
End If
End Sub
Everthing seems to work properly with the text box returning the propr
number of records.
But when I open a form based on the same table using the following code by
clicking on the ID field:
Private Sub ContactID_Click()
If Not IsNull(Me.ContactID) Then
DoCmd.OpenForm "frmContactsEdit", OpenArgs:=Me.ContactID
Else
DoCmd.OpenForm "frmContactsEdit", , , , acFormAdd 'Open the
form on a new record
End If
End Sub
After I close frmContactsEdit txtCount the underlying form shows only 1
record even though
all records are being displayed. I know this has something to do with the
fact that I am in reality
filtering frmContactsEdit to the one record.
I have Forms!frmContacts.Requery in the OnClose of frmContactsEdit to save
any changes to records.
When I remark out the requery it's fine.
So, I need to find another way to open frmContactsEdit to the desired record
a different way or find
another way to reflect any changes I made to a record in frmContactsEdit.
Any help will be appreciated,
James