I'm using MS Access 2002; when I go from design to view I'm getting runtime error 2247: There is an invalid use of the . (dot) or ! operate or invalid parenthesis.
Code is:
Private Sub Form_Load()
If fldCase_Type2.Value = 2 Then (this row is highlighted on debug)
frmS1_I2_1.Value = 3
frmS1_I2_2a.Value = 3
frmS1_I2_2b.Value = 3
frmS2_I3_1a.Value = 3
frmS2_I3_1b.Value = 3
frmS2_I4_7a.Value = 3
End If
If fldCase_Type2.Value = 3 Then
frmS1_I2_3.Value = 3
frmS1_I2_4a.Value = 3
frmS1_I2_4b.Value = 3
frmS1_I2_5.Value = 3
frmS2_I4_4.Value = 3
frmS2_I4_5.Value = 3
frmS2_I4_6a.Value = 3
frmS2_I4_6b.Value = 3
frmS2_I4_6c.Value = 3
frmS2_I4_6d.Value = 3
frmS2_I4_7b.Value = 3
End If
End Sub
I've set the default value of fldCase_Type2 to pull from the form that was open previously - code of other form is set to open this form, link the primary key info, then close the other form.
I suspect the failure is coming because the new form is loading & this code is trying to run before the default value is plugged in, because if I just type a number in the default value of fldCase_Type2 & open the form, it opens fine & the code runs correctly.
Ideas?
Thanks!
Code is:
Private Sub Form_Load()
If fldCase_Type2.Value = 2 Then (this row is highlighted on debug)
frmS1_I2_1.Value = 3
frmS1_I2_2a.Value = 3
frmS1_I2_2b.Value = 3
frmS2_I3_1a.Value = 3
frmS2_I3_1b.Value = 3
frmS2_I4_7a.Value = 3
End If
If fldCase_Type2.Value = 3 Then
frmS1_I2_3.Value = 3
frmS1_I2_4a.Value = 3
frmS1_I2_4b.Value = 3
frmS1_I2_5.Value = 3
frmS2_I4_4.Value = 3
frmS2_I4_5.Value = 3
frmS2_I4_6a.Value = 3
frmS2_I4_6b.Value = 3
frmS2_I4_6c.Value = 3
frmS2_I4_6d.Value = 3
frmS2_I4_7b.Value = 3
End If
End Sub
I've set the default value of fldCase_Type2 to pull from the form that was open previously - code of other form is set to open this form, link the primary key info, then close the other form.
I suspect the failure is coming because the new form is loading & this code is trying to run before the default value is plugged in, because if I just type a number in the default value of fldCase_Type2 & open the form, it opens fine & the code runs correctly.
Ideas?
Thanks!