Modifying Adding Records Macro

  • Thread starter Thread starter JD via AccessMonster.com
  • Start date Start date
J

JD via AccessMonster.com

How can I modified the the Add Vendor Macro to have record begin at the
next record below of last recorded entry instead of '1' all the time?

eg: I added a new record(which is record '1')to my vendor form and saved
that record. Then I went back and tried to add another one, but the record
status bar shows record '1' instead of '2'
 
JD,

Is the Data Entry property of the form set to Yes? If so, when you open
the form, you will just see a new blank record, and not the previously
entered records. Otherwise, can you check that the records you have
entered via the form have actually been added to the data in the table?
Also, let us know please what method you are using in order to open
the form and access a new record.
 
Steve,
Where do I check to see if Data Entry property of the form is set to Yes?
Most likely it is, since I went with the default.

I created a switchboard with two seperate macros that allow the user to
edit and add records to the same form. I am not having a issue with
viewing the records once I had added them through the 'Add Records Macro',
but I want to know how many previous records I have while I'm entering the
next record.

Please note: With the EditForm Macro I can add and edit records without
any problems and go directly to last record.

I wanted to see if I can do it with the AddRecord Macro, just in case the
end user wasn't Access lliterate and wanted to know the last record without
closing out that operation and going to another view to see all the records.

If this is impossible then I will inform the Access illiterate folks how to
do certain functions or tasks.
 
JD,

Ok, now I understand a bit more clearly what you are doing.

The Data Entry property is seen by looking at the Property Sheet for the
form. It is not normally the default setting for it to be set to Yes,
but that sounds like what you've got. To be frank, it seems like a
strange design to have two versions of the form, one for adding new
records and the other for editing existing records, but I guess you've
got your reasons. The navigation bar of a form only shows the records
which are part of the form's record source, and in the case of the "add
records" form, this is just the current record, since previously entered
records are excluded, so therefore it will always show 1. If you want
to persist with this model, you could put an unbound textbox on the
form, with its Control Source set to something like this:
="Record " & DCount("*","NameOfYourTable")+1
To avoid confusion, you might want to hide the navigation bar by setting
the Navigation Buttons property of the form to No.
 
Steve,

You are right! It is dumb to have an edit and add button seperately when
one will do both.

I finally realized I all had to do to accomplish my goal is to add one line
to my macro.

I added a GoToRecord conrol to my macro and set the action arguement to
'Last' right below the edit form control and I was good to go.

Thanks for leading me in the right direction.
 
Back
Top