can't find the field '|' referred to in your expression

G

Guest

I get error "Microsoft Office Access can't find the field '|' referred to in
your expression. From a form, I execute a macro that (1) checks bunches of
fields, (2) sends an email, and then (3) returns to the form and resets a
field on the form. Even though the macro correctly resets the field on the
form, when the macro completes it displays the error message. Any ideas?
 
A

Al Campagna

Marie,
You probably have a syntax error in one of the macro actions.
Please give details of each macro, and the arguments you use.

--
hth
Al Campagna . Candia Computer Consulting . Candia, NH USA
Microsoft Access MVP
http://home.comcast.net/~cccsolutions

"Find a job that you love, and you'll never work a day in your life."
 
G

Guest

Al,

At the end of the macro, I had started with just the SetValue line below,
but that's when the error message started showing up. (When I don't include
the SetValue line, I don't get an error message, but I need to reset the
date.) When the error message started popping up, I added the SelectObject
and GoToControl to make sure I was back on the form after the email gets
sent. It is the SetValue line that is causing the error. It does reset the
[ActionDate] to null, but the error pops up anyway.

Condition Action
Parameters
------------------------------------------------- -------
--------------
[JobAction]=7 And [ActionDate] Is Not Null SelectObject Object Type =
Form, Object Name = VForms, In Database Window = No

[JobAction]=7 And [ActionDate] Is Not Null GoToControl Control Name =
[ActionDate]

[JobAction]=7 And [ActionDate] Is Not Null SetValue Item =
[ActionDate], Expression = Null

Thanks!
 
A

Al Campagna

Marie,
I never work with macros... so I'll need to show you the VB code to do it. It's
simple...

If you'll explain what you're trying to do here, I can write the actual code to do
that.

Is the purpose of this macro is...
If the user changes the JobAction value to 7 you want to Null out the ActionDate? It
seems that way.

I'll assume that for now, until I hear different from you.
-------------------------------------------------------------
The code would be placed on the AfterUpdate event of JobAction...

Private Sub JobAction_AfterUpdate()
If JobAction = 7 Then
ActionDate = Null
End If
End Sub

We really don't care if ActionDate has a previous value or not... we'll just null it no
matter what.

If I'm on track so far, post back, and I'll describe how to place this code into the
form module.
--
hth
Al Campagna . Candia Computer Consulting . Candia, NH USA
Microsoft Access MVP
http://home.comcast.net/~cccsolutions

"Find a job that you love, and you'll never work a day in your life."


"Find a job that you love and you'll never work a day in your life."
Marie said:
Al,

At the end of the macro, I had started with just the SetValue line below,
but that's when the error message started showing up. (When I don't include
the SetValue line, I don't get an error message, but I need to reset the
date.) When the error message started popping up, I added the SelectObject
and GoToControl to make sure I was back on the form after the email gets
sent. It is the SetValue line that is causing the error. It does reset the
[ActionDate] to null, but the error pops up anyway.

Condition Action
Parameters
------------------------------------------------- -------
--------------
[JobAction]=7 And [ActionDate] Is Not Null SelectObject Object Type =
Form, Object Name = VForms, In Database Window = No

[JobAction]=7 And [ActionDate] Is Not Null GoToControl Control Name =
[ActionDate]

[JobAction]=7 And [ActionDate] Is Not Null SetValue Item =
[ActionDate], Expression = Null

Thanks!


Al Campagna said:
Marie,
You probably have a syntax error in one of the macro actions.
Please give details of each macro, and the arguments you use.

--
hth
Al Campagna . Candia Computer Consulting . Candia, NH USA
Microsoft Access MVP
http://home.comcast.net/~cccsolutions

"Find a job that you love, and you'll never work a day in your life."
 
G

Guest

Al,

I am executing this macro on the AfterUpdate event of my form. The full
macro copies data from the form's table to another table, updates the form's
table to reset a field, runs another macro to send an email notification
report out, and then finally gets around to resetting the Action Date field.
This macro has run fine until I added this reset at the end -- it just seemed
like such a little thing to add to have it generate this error message all
the time now.

I think I'll try putting in your code and executing that piece of code from
the macro to see if that helps. I'll let you know how it goes.

Thanks so much for your inputs.

Marie :)

Al Campagna said:
Marie,
I never work with macros... so I'll need to show you the VB code to do it. It's
simple...

If you'll explain what you're trying to do here, I can write the actual code to do
that.

Is the purpose of this macro is...
If the user changes the JobAction value to 7 you want to Null out the ActionDate? It
seems that way.

I'll assume that for now, until I hear different from you.
-------------------------------------------------------------
The code would be placed on the AfterUpdate event of JobAction...

Private Sub JobAction_AfterUpdate()
If JobAction = 7 Then
ActionDate = Null
End If
End Sub

We really don't care if ActionDate has a previous value or not... we'll just null it no
matter what.

If I'm on track so far, post back, and I'll describe how to place this code into the
form module.
--
hth
Al Campagna . Candia Computer Consulting . Candia, NH USA
Microsoft Access MVP
http://home.comcast.net/~cccsolutions

"Find a job that you love, and you'll never work a day in your life."


"Find a job that you love and you'll never work a day in your life."
Marie said:
Al,

At the end of the macro, I had started with just the SetValue line below,
but that's when the error message started showing up. (When I don't include
the SetValue line, I don't get an error message, but I need to reset the
date.) When the error message started popping up, I added the SelectObject
and GoToControl to make sure I was back on the form after the email gets
sent. It is the SetValue line that is causing the error. It does reset the
[ActionDate] to null, but the error pops up anyway.

Condition Action
Parameters
------------------------------------------------- -------
--------------
[JobAction]=7 And [ActionDate] Is Not Null SelectObject Object Type =
Form, Object Name = VForms, In Database Window = No

[JobAction]=7 And [ActionDate] Is Not Null GoToControl Control Name =
[ActionDate]

[JobAction]=7 And [ActionDate] Is Not Null SetValue Item =
[ActionDate], Expression = Null

Thanks!


Al Campagna said:
Marie,
You probably have a syntax error in one of the macro actions.
Please give details of each macro, and the arguments you use.

--
hth
Al Campagna . Candia Computer Consulting . Candia, NH USA
Microsoft Access MVP
http://home.comcast.net/~cccsolutions

"Find a job that you love, and you'll never work a day in your life."

I get error "Microsoft Office Access can't find the field '|' referred to in
your expression. From a form, I execute a macro that (1) checks bunches of
fields, (2) sends an email, and then (3) returns to the form and resets a
field on the form. Even though the macro correctly resets the field on the
form, when the macro completes it displays the error message. Any ideas?
 
A

Al Campagna

Marie,
So far, it wouldn't seem to be correct to use the AfterUpdate of the Form.
Since what happens to ActionDate is dependent upon a value from JobAction, the code to
control ActionDate value should be placed in the JobAction AfterUpdate event.
You also shouldn't need a separate "macro" to run/call the AfterUpadate code I
suggested.

If you've never done vb in form modules before... here's how.
In Design, slect JobAction
Find the AfterUpdate event in the Properties Dialog box.
Place your cursor in the text box associated with AfterUpdate
Using the arrow to the right of the text box, select Event Procedure
Click the little box on the right with 3 dots (...)
You'll see this....

Private Sub JobAction_AfterUpdate()

End Sub

Put my code between the two lines...

Private Sub JobAction_AfterUpdate()
If JobAction = 7 Then
ActionDate = Null
End If
End Sub

That's all there is to it. Now whenever JobAction is entered... or chnaged... a
decision will be made as to the value of ActionDate.

--
hth
Al Campagna . Candia Computer Consulting . Candia, NH USA
Microsoft Access MVP
http://home.comcast.net/~cccsolutions

"Find a job that you love, and you'll never work a day in your life."

Marie said:
Al,

I am executing this macro on the AfterUpdate event of my form. The full
macro copies data from the form's table to another table, updates the form's
table to reset a field, runs another macro to send an email notification
report out, and then finally gets around to resetting the Action Date field.
This macro has run fine until I added this reset at the end -- it just seemed
like such a little thing to add to have it generate this error message all
the time now.

I think I'll try putting in your code and executing that piece of code from
the macro to see if that helps. I'll let you know how it goes.

Thanks so much for your inputs.

Marie :)

Al Campagna said:
Marie,
I never work with macros... so I'll need to show you the VB code to do it. It's
simple...

If you'll explain what you're trying to do here, I can write the actual code to do
that.

Is the purpose of this macro is...
If the user changes the JobAction value to 7 you want to Null out the ActionDate?
It
seems that way.

I'll assume that for now, until I hear different from you.
-------------------------------------------------------------
The code would be placed on the AfterUpdate event of JobAction...

Private Sub JobAction_AfterUpdate()
If JobAction = 7 Then
ActionDate = Null
End If
End Sub

We really don't care if ActionDate has a previous value or not... we'll just null it
no
matter what.

If I'm on track so far, post back, and I'll describe how to place this code into the
form module.
--
hth
Al Campagna . Candia Computer Consulting . Candia, NH USA
Microsoft Access MVP
http://home.comcast.net/~cccsolutions

"Find a job that you love, and you'll never work a day in your life."


"Find a job that you love and you'll never work a day in your life."
Marie said:
Al,

At the end of the macro, I had started with just the SetValue line below,
but that's when the error message started showing up. (When I don't include
the SetValue line, I don't get an error message, but I need to reset the
date.) When the error message started popping up, I added the SelectObject
and GoToControl to make sure I was back on the form after the email gets
sent. It is the SetValue line that is causing the error. It does reset the
[ActionDate] to null, but the error pops up anyway.

Condition Action
Parameters
------------------------------------------------- -------
--------------
[JobAction]=7 And [ActionDate] Is Not Null SelectObject Object Type =
Form, Object Name = VForms, In Database Window = No

[JobAction]=7 And [ActionDate] Is Not Null GoToControl Control Name =
[ActionDate]

[JobAction]=7 And [ActionDate] Is Not Null SetValue Item =
[ActionDate], Expression = Null

Thanks!


:

Marie,
You probably have a syntax error in one of the macro actions.
Please give details of each macro, and the arguments you use.

--
hth
Al Campagna . Candia Computer Consulting . Candia, NH USA
Microsoft Access MVP
http://home.comcast.net/~cccsolutions

"Find a job that you love, and you'll never work a day in your life."

I get error "Microsoft Office Access can't find the field '|' referred to in
your expression. From a form, I execute a macro that (1) checks bunches of
fields, (2) sends an email, and then (3) returns to the form and resets a
field on the form. Even though the macro correctly resets the field on the
form, when the macro completes it displays the error message. Any ideas?
 

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

Top