467,169 Members | 984 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,169 developers. It's quick & easy.

VBA DoCmd.GoToRecord , , acNewRec in first row

Hello,
I have my data sorted on date desc in my form (multiple recs/table
style). When I want to insert a new record (with my self made button
and vba code(DoCmd.GoToRecord , , acNewRec)) the prompt will go after
the last record of my form. Is there a way to insert BEFORE the first
record (so before the last inserted record) in top of my screen?

It would surprise me though!

Stack

W2000 / Access2003/ in 2000 record style

Nov 13 '05 #1
  • viewed: 15296
Share:
5 Replies
so add the record and then sort again.

Now was that so hard?

Nov 13 '05 #2
:)
So what you are basically saying is that Access always inserts a record
at the end of the row regardless of the way it was sorted and that I
have to trick to get what I want? If so, so be it.

Nov 13 '05 #3
A table, as defined in the SQL standard, has no order. It is just a
record bucket.

The design choice of placing the new record at the bottom may have
historical background, or just code simplification urges. Most
environments that let me add new records, do so at the end of the list.

When you insert a new record, there is nothing to derive its sorted
order position from, so the only available location would be at the very
top. If that is what you want to see, you may try to program this. If
your records have a primary key that is invisible to the user, or cannot
be manipulated, you can create a command button that does the insert of
a new record, sort descending on the primary key, and set focus to the
new record. The last step shouldn't need coding because when you sort a
table, the first record will become current, and if you've inserted a
new one, that will likely be the one with the highest key.

Stack wrote:
:)
So what you are basically saying is that Access always inserts a record
at the end of the row regardless of the way it was sorted and that I
have to trick to get what I want? If so, so be it.


--
Bas Cost Budde, Holland
http://www.heuveltop.nl/BasCB/msac_index.html
For human replies, replace the queue with a tea

Nov 13 '05 #4
Bedankt Bas,
ik zal jouw tip eens uitproberen!
m.v.g.
Simon Tak

Nov 13 '05 #5
Huh? Spreek je moerstaal man :-) Als het dan in het Nederlands kan, mail
me gerust direct

Stack wrote:
Bedankt Bas,
ik zal jouw tip eens uitproberen!
m.v.g.
Simon Tak


--
Bas Cost Budde, Holland
http://www.heuveltop.nl/BasCB/msac_index.html
For human replies, replace the queue with a tea

Nov 13 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by David | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.