Last Record in a Table

T

thefonz37

I have a macro that performs actions on data in a table and then advances to
the next record in that table. The issue I'd like to solve is that I would
like a custom message to pop up when the end of the data is reached, rather
than the somewhat-cryptic message that Access provides by default. Is there
a way to change this? Or is there a way to test if performing a "Next"
operation can complete or not? I'm kind of new to using criteria in macros,
so I'm not sure how this would work.
 
T

tina

depends what version of Access you're using. i seem to remember someone
telling me that A2007 has error handling for macros, but not having that
version i can't verify. if you're using a prior version, you can't handle
errors in macros, you need to use VBA. if you've never used VBA, this is a
good time to get started; it's much more powerful and flexible than macros,
and you *can* learn it even if you've never used a programming language
before (i know this from experience <g>).

suggest you start by converting your macro to VBA. Access has a tool to do
this for you; in A2003, select the macro in the database window (you don't
need to open it), then click Tool | Macro | Convert Macros to Visual Basic.
go ahead and include error handling when asked, so you'll have an example of
how it's done. another thing you can do is add a command button to a form
using the Command Button Wizard, which will write basic code for the chosen
operation.

make liberal use of VBA Help, and come back to the newsgroups for help and
suggestions on how to learn more.

hth
 
S

Steve Schapel

Thefonz,

You can use a Condition in your macro like this:
[RecordsetClone].[RecordCount]>[CurrentRecord]
 

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