Run Time Error 2465

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
 
D

Douglas J. Steele

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.
 
B

blandis

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
 
D

Douglas J. Steele

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
 
A

Access User

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top