MontyBurns
Programmer
Hi,
I have a subform (frmSubFiles) with some code which does a recordcount and updates a txtbox on the parent form (frmIFLR).
Private Sub Form_Current()
Dim intIFLRid As Long
If Not IsNull(Forms!frmIFLR.IFLRid) Then
intIFLRid = Forms!frmIFLR.IFLRid
Else:
intIFLRid = 0
End If
Forms!frmIFLR.txtNumOfFiles = DCount("*", _
"tblIFLRtoClient", "IFLRid = " & intIFLRid)
End Sub
This works fine initially, but when I click on a command button on the parent form to open a new instance of itself, the code gets confused.
It doesn't seem to know which instance it should look at. I could use the Public variable which is holding the reference to the new instance of the form to refer to the main form, but then what about the initial instance of the form?
What can I do?
Thanks,
Burns
I have a subform (frmSubFiles) with some code which does a recordcount and updates a txtbox on the parent form (frmIFLR).
Private Sub Form_Current()
Dim intIFLRid As Long
If Not IsNull(Forms!frmIFLR.IFLRid) Then
intIFLRid = Forms!frmIFLR.IFLRid
Else:
intIFLRid = 0
End If
Forms!frmIFLR.txtNumOfFiles = DCount("*", _
"tblIFLRtoClient", "IFLRid = " & intIFLRid)
End Sub
This works fine initially, but when I click on a command button on the parent form to open a new instance of itself, the code gets confused.
It doesn't seem to know which instance it should look at. I could use the Public variable which is holding the reference to the new instance of the form to refer to the main form, but then what about the initial instance of the form?
What can I do?
Thanks,
Burns