Run Time Error 2465

  • Thread starter Thread starter blandis
  • Start date Start date
B

blandis

We are getting the above error with the following message:
Microsoft Office Access can't find the field "|" referred to in your
expression.

code:
Private Sub EditAppt_Click()
'Opens the edit add/edit client appointment time and date

If IsNull([subfrm:1040 Appointments].Form![Curr Tax Yr]) Then
DoCmd.OpenForm "frm:_bfl_ AddEdit Appts", , , , acFormAdd
Else
DoCmd.OpenForm "frm:_bfl_AddEdit Appts", , , "[CltID] = " & [ID] & "
AND [TaxYear] = " & [subfrm: 1040 Appointments].Form![Curr Tax Yr]
End If

End Sub
 
I'd recommend renaming your forms. Having special characters (like :) in
your names can lead to all sorts of problems, and this may well be one of
them.
 
I do not have any colons in my form names

Douglas J. Steele said:
I'd recommend renaming your forms. Having special characters (like :) in
your names can lead to all sorts of problems, and this may well be one of
them.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


blandis said:
We are getting the above error with the following message:
Microsoft Office Access can't find the field "|" referred to in your
expression.

code:
Private Sub EditAppt_Click()
'Opens the edit add/edit client appointment time and date

If IsNull([subfrm:1040 Appointments].Form![Curr Tax Yr]) Then
DoCmd.OpenForm "frm:_bfl_ AddEdit Appts", , , , acFormAdd
Else
DoCmd.OpenForm "frm:_bfl_AddEdit Appts", , , "[CltID] = " & [ID] &
"
AND [TaxYear] = " & [subfrm: 1040 Appointments].Form![Curr Tax Yr]
End If

End Sub
 
Your sample code shows them


If IsNull([subfrm:1040 Appointments].Form![Curr Tax Yr]) Then
DoCmd.OpenForm "frm:_bfl_ AddEdit Appts", , , , acFormAdd
Else
DoCmd.OpenForm "frm:_bfl_AddEdit Appts", , , "[CltID] = " & [ID] & " AND
[TaxYear] = " & [subfrm: 1040 Appointments].Form![Curr Tax Yr]
End If

You've got colons in frm:_bfl_AddEdit Appts and subfrm: 1040 Appointments.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


blandis said:
I do not have any colons in my form names

Douglas J. Steele said:
I'd recommend renaming your forms. Having special characters (like :) in
your names can lead to all sorts of problems, and this may well be one of
them.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


blandis said:
We are getting the above error with the following message:
Microsoft Office Access can't find the field "|" referred to in your
expression.

code:
Private Sub EditAppt_Click()
'Opens the edit add/edit client appointment time and date

If IsNull([subfrm:1040 Appointments].Form![Curr Tax Yr]) Then
DoCmd.OpenForm "frm:_bfl_ AddEdit Appts", , , , acFormAdd
Else
DoCmd.OpenForm "frm:_bfl_AddEdit Appts", , , "[CltID] = " & [ID]
&
"
AND [TaxYear] = " & [subfrm: 1040 Appointments].Form![Curr Tax Yr]
End If

End Sub
 
I don't know if this deserves to be put into a new 'thread' but the following
VBA is getting one of those 2465ers as well:

Private Sub Form_AfterUpdate()

Call LockBoundControls(Me, Nz(Me("MRA_Form").Form!Complete.Value, False),
"Complete")

End Sub

Private Sub Form_Current()

Call LockBoundControls(Me, Nz(Me("MRA_Form").Form!Complete.Value, False),
"Complete")

End Sub

the code is being called from a parent of the sub-form "MRA Form".

Douglas J. Steele said:
Your sample code shows them


If IsNull([subfrm:1040 Appointments].Form![Curr Tax Yr]) Then
DoCmd.OpenForm "frm:_bfl_ AddEdit Appts", , , , acFormAdd
Else
DoCmd.OpenForm "frm:_bfl_AddEdit Appts", , , "[CltID] = " & [ID] & " AND
[TaxYear] = " & [subfrm: 1040 Appointments].Form![Curr Tax Yr]
End If

You've got colons in frm:_bfl_AddEdit Appts and subfrm: 1040 Appointments.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


blandis said:
I do not have any colons in my form names

Douglas J. Steele said:
I'd recommend renaming your forms. Having special characters (like :) in
your names can lead to all sorts of problems, and this may well be one of
them.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


We are getting the above error with the following message:
Microsoft Office Access can't find the field "|" referred to in your
expression.

code:
Private Sub EditAppt_Click()
'Opens the edit add/edit client appointment time and date

If IsNull([subfrm:1040 Appointments].Form![Curr Tax Yr]) Then
DoCmd.OpenForm "frm:_bfl_ AddEdit Appts", , , , acFormAdd
Else
DoCmd.OpenForm "frm:_bfl_AddEdit Appts", , , "[CltID] = " & [ID]
&
"
AND [TaxYear] = " & [subfrm: 1040 Appointments].Form![Curr Tax Yr]
End If

End Sub
 
Back
Top