By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,197 Members | 1,173 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,197 IT Pros & Developers. It's quick & easy.

VBA DoCmd.GoToRecord , , acNewRec in first row

P: n/a
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
Share this Question
Share on Google+
5 Replies


P: n/a
so add the record and then sort again.

Now was that so hard?

Nov 13 '05 #2

P: n/a
:)
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

P: n/a
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

P: n/a
Bedankt Bas,
ik zal jouw tip eens uitproberen!
m.v.g.
Simon Tak

Nov 13 '05 #5

P: n/a
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.