473,395 Members | 1,975 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

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
5 15768
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Eric | last post by:
What's the best way to cancel the new record when doCmd.GoToRecord , , acNewRec is executed and before the new record is actually written to the database. I'm maintaining an existing Access 97...
1
by: STeve Lefevre | last post by:
Hey folks -- I'm using the DoCmd.GoToRecord , , acNext to jump to the next record after the user enters a value. The problem is, it throws an error if it's already on the last record! What's the...
0
by: Timppa | last post by:
Hi, I'm converting ACCESS 2000 database to SQL Server. I have .adp project. In the .mdb I have form where I'll insert rows into two different tables using docmd.GoToRecod ,,acNewRec. In .adp...
6
by: David | last post by:
I am trying to insert an employee number into the EmpNbr field in my main table from a form where I add a new employee to my employee table. I was hoping this command would work, but it isn't. ...
8
JAMBAI
by: JAMBAI | last post by:
Hi, Is there a way to handle single quotes when inserting the records using the below do command. Or do I need to write Insert sql. DoCmd.GoToRecord , , acNewRec Thanks Jambai
1
by: vostrixos | last post by:
Hi all,i need some help I'm working on a access project were i use a lot the docmd.gotorecord ,,next ..first ..last method and i use only once the DoCmd.GoToRecord , , acNewRec.Everything was...
3
martintallett
by: martintallett | last post by:
Help! I am trying to replace the Access Find button functionality on an old database. I can make it work when I use a basic form with bound fields and a button which shows a popup form which...
2
by: aaronyoung | last post by:
I have been using this forum to answer many questions regarding an Access database I am building (my first attempt at something like this - teaching myself as I go), and I've always been able to find...
5
by: phill86 | last post by:
Hi I have a main form that holds records for scheduled meetings, date time location etc... in that form i have a sub form that has a list of equipment resources that you can assign to the meeting in...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.