C
cw via AccessMonster.com
I have two Forms, that open up the same frmCPUpdate:
------------------------------------------------------------
- frmCPtypeAndLataRS
- frmCPtypeAndLataRS_Static
When frmCPUpdate opens, the following code runs.
-------------------------------------------------------------
Private Sub Form_Open(Cancel As Integer)
Me.Requery
Me.CustomerName = [Forms]![frmCPtypeAndLataRS_Static]![CustName]
Me.Phone = [Forms]![frmCPtypeAndLataRS_Static]![PhoneNum]
Me.LATA = [Forms]![frmCPtypeAndLataRS_Static]![LataVal]
Me.City = [Forms]![frmCPtypeAndLataRS_Static]![CityVal]
Me.FicTN = [Forms]![frmCPtypeAndLataRS_Static]![FicTNVal]
Me.VerCircuit = [Forms]![frmCPtypeAndLataRS_Static]![Text78]
End Sub
-------------------------------------------------------------
This works fine from "frmCPtypeAndLataRS_Static" , but fails on the other,
because the Form name is "Hard-Coded" in my code above.
Question: How do I change this code, to handle both occurences of my forms?
Would I use some type of CASE IF/ELSE statement that determines the source
Form, then references the correct Form?
Thanks,
cw
------------------------------------------------------------
- frmCPtypeAndLataRS
- frmCPtypeAndLataRS_Static
When frmCPUpdate opens, the following code runs.
-------------------------------------------------------------
Private Sub Form_Open(Cancel As Integer)
Me.Requery
Me.CustomerName = [Forms]![frmCPtypeAndLataRS_Static]![CustName]
Me.Phone = [Forms]![frmCPtypeAndLataRS_Static]![PhoneNum]
Me.LATA = [Forms]![frmCPtypeAndLataRS_Static]![LataVal]
Me.City = [Forms]![frmCPtypeAndLataRS_Static]![CityVal]
Me.FicTN = [Forms]![frmCPtypeAndLataRS_Static]![FicTNVal]
Me.VerCircuit = [Forms]![frmCPtypeAndLataRS_Static]![Text78]
End Sub
-------------------------------------------------------------
This works fine from "frmCPtypeAndLataRS_Static" , but fails on the other,
because the Form name is "Hard-Coded" in my code above.
Question: How do I change this code, to handle both occurences of my forms?
Would I use some type of CASE IF/ELSE statement that determines the source
Form, then references the correct Form?
Thanks,
cw