Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MS Access 2002 - Runtime error 2247

Status
Not open for further replies.

TammyT

Programmer
Sep 17, 2003
183
US
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!
 
What is fldCase_Type2?

Is it a text box?

If so, have you tried just saying:
Code:
If fldCase_Type2 = 2 Then

?

 
Thanks - that did it (plus a little code fixing elsewhere!)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top