A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » New Users
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Finding Last Record



 
 
Thread Tools Display Modes
  #1  
Old March 18th, 2010, 07:12 PM posted to microsoft.public.access.gettingstarted
Wes[_3_]
external usenet poster
 
Posts: 6
Default Finding Last Record

Being very new to Access I am struggling a bit, so need some assistance.
I have an ACCESS 2000 manual and keep trying to figure it out, but I
am just a bit ACCESS deprived.

I have a form that will be used for New Employees. When I OPEN the
form, (OPEN event, I think,) I need to get to the last record in my
table. I have tried

DoCmd.GoToRecord acDataTable, "SalesAssociate", acLast

but get an error saying the table is not open.

I have tried several other things, but nothing seems to work.

I know I have it wrong, but can't figure it out.

Any suggestions

Thanks

Wes
Ads
  #2  
Old March 18th, 2010, 07:33 PM posted to microsoft.public.access.gettingstarted
Jeff Boyce
external usenet poster
 
Posts: 8,621
Default Finding Last Record

Wes

Access tables store data rather like "buckets o' data". That is, there's no
inherent (human-perceptible) order. Thus, the "Last" record only makes
sense if YOU have imposed some sort order.

What you YOU mean by "last"?

Regards

Jeff Boyce
Microsoft Access MVP

--
Disclaimer: This author may have received products and services mentioned
in this post. Mention and/or description of a product or service herein
does not constitute endorsement thereof.

Any code or pseudocode included in this post is offered "as is", with no
guarantee as to suitability.

You can thank the FTC of the USA for making this disclaimer
possible/necessary.

"Wes" wrote in message
...
Being very new to Access I am struggling a bit, so need some assistance. I
have an ACCESS 2000 manual and keep trying to figure it out, but I am just
a bit ACCESS deprived.

I have a form that will be used for New Employees. When I OPEN the form,
(OPEN event, I think,) I need to get to the last record in my table. I
have tried

DoCmd.GoToRecord acDataTable, "SalesAssociate", acLast

but get an error saying the table is not open.

I have tried several other things, but nothing seems to work.

I know I have it wrong, but can't figure it out.

Any suggestions

Thanks

Wes



  #3  
Old March 18th, 2010, 07:42 PM posted to microsoft.public.access.gettingstarted
J_Goddard via AccessMonster.com
external usenet poster
 
Posts: 221
Default Finding Last Record

Hi -

If you are using this in a form, try using DoCmd.GoToRecord ,,acLast.

This will go to the last record in whatever dataset the form is using as its
RecordSource,
e.g. tblEmployee

If you are using the form to add new data, use acNew instead of acLast.



John



Wes wrote:
Being very new to Access I am struggling a bit, so need some assistance.
I have an ACCESS 2000 manual and keep trying to figure it out, but I
am just a bit ACCESS deprived.

I have a form that will be used for New Employees. When I OPEN the
form, (OPEN event, I think,) I need to get to the last record in my
table. I have tried

DoCmd.GoToRecord acDataTable, "SalesAssociate", acLast

but get an error saying the table is not open.

I have tried several other things, but nothing seems to work.

I know I have it wrong, but can't figure it out.

Any suggestions

Thanks

Wes


--
John Goddard
Ottawa, ON Canada
jrgoddard at cyberus dot ca

Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...arted/201003/1

  #4  
Old March 18th, 2010, 07:49 PM posted to microsoft.public.access.gettingstarted
Wes[_3_]
external usenet poster
 
Posts: 6
Default Finding Last Record

On 3/18/2010 3:33 PM, Jeff Boyce wrote:
Wes

Access tables store data rather like "buckets o' data". That is, there's no
inherent (human-perceptible) order. Thus, the "Last" record only makes
sense if YOU have imposed some sort order.

What you YOU mean by "last"?

Regards

Jeff Boyce
Microsoft Access MVP

I need to ADD a new employee. In the Access manual, looking at the
sequence of events, it indicates that using the OPEN event you can
determine if this is a "new" reocrd. If so, you need to move to the end
of the recordset. Otherwise you will continue to use the first record.

Unfortunately, I am at a big disadvantage. I have several years of
experience using the "big" relational databases, Oracle, Sybase, DB2,
etc., and the programming is completely different. I am trying to learn
to use ACCESS for a small business I am starting. At the moment it is
challenging, but it looks like a really cool facility that has a lot of
power.

Oh, I do have some small amount of VBA experience, but that is from the
EXCEL perspective.

Thanks for the help

Wes
  #5  
Old March 18th, 2010, 08:23 PM posted to microsoft.public.access.gettingstarted
Jeff Boyce
external usenet poster
 
Posts: 8,621
Default Finding Last Record

Since Access tables are buckets o' data, you do not need to go to the last
record before adding a new one.

Check Access HELP for "adding a new record".

There's even a property in forms that lets them be used ONLY for entering
new records. Again, Access keeps track of where it gets added, so you don't
have to.

Good luck!

Regards

Jeff Boyce
Microsoft Access MVP

--
Disclaimer: This author may have received products and services mentioned
in this post. Mention and/or description of a product or service herein
does not constitute endorsement thereof.

Any code or pseudocode included in this post is offered "as is", with no
guarantee as to suitability.

You can thank the FTC of the USA for making this disclaimer
possible/necessary.

"Wes" wrote in message
...
On 3/18/2010 3:33 PM, Jeff Boyce wrote:
Wes

Access tables store data rather like "buckets o' data". That is, there's
no
inherent (human-perceptible) order. Thus, the "Last" record only makes
sense if YOU have imposed some sort order.

What you YOU mean by "last"?

Regards

Jeff Boyce
Microsoft Access MVP

I need to ADD a new employee. In the Access manual, looking at the
sequence of events, it indicates that using the OPEN event you can
determine if this is a "new" reocrd. If so, you need to move to the end
of the recordset. Otherwise you will continue to use the first record.

Unfortunately, I am at a big disadvantage. I have several years of
experience using the "big" relational databases, Oracle, Sybase, DB2,
etc., and the programming is completely different. I am trying to learn
to use ACCESS for a small business I am starting. At the moment it is
challenging, but it looks like a really cool facility that has a lot of
power.

Oh, I do have some small amount of VBA experience, but that is from the
EXCEL perspective.

Thanks for the help

Wes



  #6  
Old March 18th, 2010, 11:42 PM posted to microsoft.public.access.gettingstarted
John Spencer
external usenet poster
 
Posts: 7,815
Default Finding Last Record

If you want to move to the last record that the form is bound to.

DoCmd.GoToRecord acDataForm, "NameOfForm", acLast




John Spencer
Access MVP 2002-2005, 2007-2010
The Hilltop Institute
University of Maryland Baltimore County

Wes wrote:
Being very new to Access I am struggling a bit, so need some assistance.
I have an ACCESS 2000 manual and keep trying to figure it out, but I am
just a bit ACCESS deprived.

I have a form that will be used for New Employees. When I OPEN the
form, (OPEN event, I think,) I need to get to the last record in my
table. I have tried

DoCmd.GoToRecord acDataTable, "SalesAssociate", acLast

but get an error saying the table is not open.

I have tried several other things, but nothing seems to work.

I know I have it wrong, but can't figure it out.

Any suggestions

Thanks

Wes

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 02:20 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
Copyright 2004-2019 OfficeFrustration.
The comments are property of their posters.