Run time error 2450

  • Thread starter Thread starter Deenos2000
  • Start date Start date
D

Deenos2000

I am getting runtime 2450 based on the following code. I checked the spelling
of the form it refers to and the spelling is correct. Can anyone help me.
Here is the code:
Private Sub Form_Current()
Dim dbjoi As DAO.Database
Dim rstMailingGrp As DAO.recordset
Dim strSQl As String
Dim AccNum As Long

chk2 = False
chk7 = False
Check32 = False
chk4 = False
chk10 = False
chk8 = False
chk9 = False
chkConvMar = False
chkGenInt = False
chk26 = False
chkLay = False

'On Error Resume Next

If Not IsNull(Forms!AddEditDeleteRECORDS!AcctNum) Then
AccNum = Forms!AddEditDeleteRECORDS!AcctNum
strSQl = "SELECT * FROM MailingGroupsInfo WHERE AcctNum = " & AccNum
Set dbjoi = CurrentDb()
Set rstMailingGrp = dbjoi.OpenRecordset(strSQl, dbOpenDynaset)

Do Until rstMailingGrp.EOF
If rstMailingGrp!MailingGrpID = 2 Then chk2 = True
If rstMailingGrp!MailingGrpID = 7 Then chk7 = True
If rstMailingGrp!MailingGrpID = 18 Then Check32 = True
If rstMailingGrp!MailingGrpID = 4 Then chk4 = True
If rstMailingGrp!MailingGrpID = 10 Then chk10 = True
If rstMailingGrp!MailingGrpID = 8 Then chk8 = True
If rstMailingGrp!MailingGrpID = 9 Then chk9 = True
If rstMailingGrp!MailingGrpID = 14 Then chkConvMar = True
If rstMailingGrp!MailingGrpID = 13 Then chkGenInt = True
If rstMailingGrp!MailingGrpID = 16 Then chk26 = True
If rstMailingGrp!MailingGrpID = 17 Then chkLay = True

rstMailingGrp.MoveNext
Loop
rstMailingGrp.Close
End If
End Sub
 
Are you sure the form is open when you're executing the code? What line
does the error occur on, the "If Not IsNull" line?


Rob
 
Back
Top