Macro error

M

Marvin Ettlin

I have a macro to filter my data...it sorts the data
fine. But at the end of the record set, it gives me a
message that says "you can't go to the specified record,
You may be at the end of your record set" (which is
fine), but then it haults teh macro with a Action Failed
Dialog box... It still works, but I want to stop this
Action Failed Box and just say you are at the end of your
record set and continue on... or start over. Is this
possible?
 
K

Ken Snell

Not knowing anything about what your macro is doing, it's hard to say. Can
you give us more info, please? Why would a macro that filters cause you to
error at the end of a recordset?
 
M

Marvin Ettlin

My macro opens the form and runs a filter on a set of
records -- it sorts the records according to building
number and allows me to edit all the people assigned to
that building. I have to make it as child-proof as
possible so I had to disable the navagation bar in the
records. The problem is that once I hit the end of the
record set or back up beyond the first record of the
set... that is when I get the halt macro window... not
terrible in that the records still are sorted and i can
continue to do what I am doing... but it is just an
anoyance is all... Maybe It is that I didn't set the
macro up right...

Marv
 
K

Ken Snell

Can you post the steps in your macro? I am not following how a macro is
navigating you through the form if you're manually entering records' data?
 
M

Marvin Ettlin

Macro is:
OpenForm
(Properities are:
Form Name:personnel Records
View:Form
Filter Name:
Condition:[Enter Building]=[Personnel]![Building]
Data Mode:Edit
Window Mode:Normal

That is my filter of files. I then have a next button on
the form that is linked to this:
GoToRecord
(Properities are:
Object Type:
Object Name:
Record:Next
Offset:

This is how I navigate through the recordset (and the one
that is giving me the problems). Maybe it is in written
wrong and does it all the time, but I only discover it
after running the first macro, due to the limitted size,
(the entire db is over 1000 records). The message
is: "You can't go to the specified record, You may be at
the end of the recordset" (which is what I expect) but
the one I want to get rid of is then in a table form that
says:
ACTION FAILED:
Macro Name:Next Record
Condition:True
Action name:GoToRecord
Augments:1,,Next

Any help you can give me on it would be GREATLY
appreciated...

Marv
 
K

Ken Snell

So long as you don't use the command button to move to a "new" record, you
could use a condition that tests for the current record to see if it's the
last one. This will require that you hardcode the form's name into the
macro's condition (note that the condition is all one line, but it'll likely
be wordwrapped by the newsreader):

Condition: Forms!FormName.Form.Recordset.AbsolutePosition =
Forms!FormName.Form.RecordsetClone.RecordCount - 1
Action: MsgBox
Message: You are at the last record.

Condition: ...
Action: StopMacro

Condition: (blank)
Action: GoToRecord
Record: Next


--
Ken Snell
<MS ACCESS MVP>




Marvin Ettlin said:
Macro is:
OpenForm
(Properities are:
Form Name:personnel Records
View:Form
Filter Name:
Condition:[Enter Building]=[Personnel]![Building]
Data Mode:Edit
Window Mode:Normal

That is my filter of files. I then have a next button on
the form that is linked to this:
GoToRecord
(Properities are:
Object Type:
Object Name:
Record:Next
Offset:

This is how I navigate through the recordset (and the one
that is giving me the problems). Maybe it is in written
wrong and does it all the time, but I only discover it
after running the first macro, due to the limitted size,
(the entire db is over 1000 records). The message
is: "You can't go to the specified record, You may be at
the end of the recordset" (which is what I expect) but
the one I want to get rid of is then in a table form that
says:
ACTION FAILED:
Macro Name:Next Record
Condition:True
Action name:GoToRecord
Augments:1,,Next

Any help you can give me on it would be GREATLY
appreciated...

Marv
-----Original Message-----
Can you post the steps in your macro? I am not following how a macro is
navigating you through the form if you're manually entering records' data?
--
Ken Snell
<MS ACCESS MVP>





.
 
M

Marvin Ettlin

Thanks.... It works!
-----Original Message-----
So long as you don't use the command button to move to a "new" record, you
could use a condition that tests for the current record to see if it's the
last one. This will require that you hardcode the form's name into the
macro's condition (note that the condition is all one line, but it'll likely
be wordwrapped by the newsreader):

Condition: Forms!
FormName.Form.Recordset.AbsolutePosition =
Forms!FormName.Form.RecordsetClone.RecordCount - 1
Action: MsgBox
Message: You are at the last record.

Condition: ...
Action: StopMacro

Condition: (blank)
Action: GoToRecord
Record: Next


--
Ken Snell
<MS ACCESS MVP>




Macro is:
OpenForm
(Properities are:
Form Name:personnel Records
View:Form
Filter Name:
Condition:[Enter Building]=[Personnel]![Building]
Data Mode:Edit
Window Mode:Normal

That is my filter of files. I then have a next button on
the form that is linked to this:
GoToRecord
(Properities are:
Object Type:
Object Name:
Record:Next
Offset:

This is how I navigate through the recordset (and the one
that is giving me the problems). Maybe it is in written
wrong and does it all the time, but I only discover it
after running the first macro, due to the limitted size,
(the entire db is over 1000 records). The message
is: "You can't go to the specified record, You may be at
the end of the recordset" (which is what I expect) but
the one I want to get rid of is then in a table form that
says:
ACTION FAILED:
Macro Name:Next Record
Condition:True
Action name:GoToRecord
Augments:1,,Next

Any help you can give me on it would be GREATLY
appreciated...

Marv
-----Original Message-----
Can you post the steps in your macro? I am not
following
how a macro is
navigating you through the form if you're manually entering records' data?
--
Ken Snell
<MS ACCESS MVP>


My macro opens the form and runs a filter on a set of
records -- it sorts the records according to building
number and allows me to edit all the people assigned to
that building. I have to make it as child-proof as
possible so I had to disable the navagation bar in the
records. The problem is that once I hit the end of the
record set or back up beyond the first record of the
set... that is when I get the halt macro window... not
terrible in that the records still are sorted and i can
continue to do what I am doing... but it is just an
anoyance is all... Maybe It is that I didn't set the
macro up right...

Marv

-----Original Message-----
Not knowing anything about what your macro is doing,
it's hard to say. Can
you give us more info, please? Why would a macro that
filters cause you to
error at the end of a recordset?

--
Ken Snell
<MS ACCESS MVP>

"Marvin Ettlin"
wrote in message
I have a macro to filter my data...it sorts the data
fine. But at the end of the record set, it gives me a
message that says "you can't go to the specified
record,
You may be at the end of your record set" (which is
fine), but then it haults teh macro with a Action
Failed
Dialog box... It still works, but I want to stop this
Action Failed Box and just say you are at the end of
your
record set and continue on... or start over. Is this
possible?


.



.


.
 

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