Run-time error '2465' can't find the field '|1' referred to in your expression (1 Viewer)

princessdmb

Registered User.
Local time
Today, 09:52
Joined
Sep 1, 2011
Messages
15
Hello,

Getting an error message "Run-time error '2465' can't find the field '|1' referred to in your expression" every time i click my submit button from my form.

Here's my code

Private Sub Command128_Click()
If IsNull([Doc-ID_RQN-No]) Then
MsgBox "The eCAPS Document ID is missing, please enter the ID number."
ElseIf [Forms]![eCAPS_OrderRqt_frm].[Form].[txtOrderStatus] = "eCAPS" Then
[Forms]![eCAPS_OrderRqt_frm].[Form].[txtOrderStatus] = "Pending OPS Approval (eCAPS)"

End If


Me.eCAPS_EntryDate.Value = Date

DoCmd.Close acForm, "eCAPS_OrderRqt_frm", acSaveNo
MsgBox "ePurchase Request has been updated and sent to OPS Management Review"

DoCmd.OpenForm "SearchBuyerOrder_frm", acNormal, ""

End Sub

Please see attached screen shots, what i need is when a user clicks the Submit button the Request status [txtOrderStatus] changes from eCAPS to Pnd Ops Approval, automatically add the current date and close down the form. But if the eCAPS Doc ID is blank, then a message would display indicating that eCAPS id# is missing and cannot change the status until the id# is entered.

Please help.:banghead:
 

Attachments

  • eCAPS_FrmView.jpg
    eCAPS_FrmView.jpg
    87.3 KB · Views: 222
  • eCAPS_DesignView.jpg
    eCAPS_DesignView.jpg
    98.1 KB · Views: 209
  • VBA_SubmitButton.jpg
    VBA_SubmitButton.jpg
    53.3 KB · Views: 216

Ranman256

Well-known member
Local time
Today, 12:52
Joined
Apr 9, 2015
Messages
4,337
when your code stops on the bad line,
open the immediate window and debug (ctl-G)
type: ?[Forms]![eCAPS_OrderRqt_frm].[Form].[txtOrderStatus]
and press enter
this will show the value of the object.
but this looks more like a query error than a text box error.
Esp. if your index [Doc-ID_RQN-No] is missing then you cant look at the sub form.
 

princessdmb

Registered User.
Local time
Today, 09:52
Joined
Sep 1, 2011
Messages
15
Its giving me the same error when i press enter. Please see attachment.

I do have subforms one where user can enter notes and the other where they can only view items they want to purchase.

For my query, its pulling the AutoID record (Purchase order) from my search page.
 

Attachments

  • VBA_Immediate.jpg
    VBA_Immediate.jpg
    91.6 KB · Views: 209
  • eCAPS_OrderRqt_frm_QryView.jpg
    eCAPS_OrderRqt_frm_QryView.jpg
    90 KB · Views: 206

Ranman256

Well-known member
Local time
Today, 12:52
Joined
Apr 9, 2015
Messages
4,337
so when you have the form open,
then manually open that query, it work correctly?

if so, it could be an error on something else besides the query.
SOMETHING in the form has this strange 'bar 1' in it and cant use it.
 

Users who are viewing this thread

Top Bottom