472,961 Members | 2,243 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

Goto Last Record and Open Form at same time ?

Hi,

I have managed to simplify my problem but can't seem to get this to work.

I want to open up a form from a click event of another form, but not only
open the form when the button is pressed but also move to the last record.

DoCmd.OpenForm "My-Form-Name", acNormal

Opens the form with no problem.....

But the next line....

DoCmd.GoToRecord , , acLast

DoCmd.Close acForm, Me.Name

Doesn't seem to get the form to move to the last record, only shows 1st
record of n.

And !!! I don't want to put the code:

DoCmd.GoToRecord , , acLast

into the form load event, or on open event either because I want it to only
move to the last record for my specific click event and not always when the
form is opened from other methods.

What am i missing here ? How do I code all this in one line ?

Thanks
Nov 12 '05 #1
3 23808
Try:

DoCmd.OpenForm "My-Form-Name", acNormal

docmd.gotorecord acDataForm, "My forname", acLast
--
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada
pl******************@msn.com
http://www.attcanada.net/~kallal.msn
Nov 12 '05 #2
Albert,

This does not work !

It opens the form no problem.

But the form opens at record 1 of n, and NOT on the last record.

There must be a way ? I have only been able to open the form to the last
record
if I place your second line in the form on open event, but then that is not
what I
intend to do, it needs to open from the click event to the last record -
only.

Let me know.
"Albert D. Kallal" <pl********************@msn.com> wrote in message
news:Napec.85464$oR5.82460@pd7tw3no...
Try:

DoCmd.OpenForm "My-Form-Name", acNormal

docmd.gotorecord acDataForm, "My forname", acLast
--
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada
pl******************@msn.com
http://www.attcanada.net/~kallal.msn

Nov 12 '05 #3
I think I figured it out, you wouldn't believe it !

I had a line that closes my current form where the click even occurs, this
line of code was placed last in the
procedure. Intead I placed this line of code as the 1st line in the
procedure. For some reason it works
now.
"BLUE WATER" <no**********@nowhere.com> wrote in message
news:Ne**************@news04.bloor.is.net.cable.ro gers.com...
Albert,

This does not work !

It opens the form no problem.

But the form opens at record 1 of n, and NOT on the last record.

There must be a way ? I have only been able to open the form to the last
record
if I place your second line in the form on open event, but then that is not what I
intend to do, it needs to open from the click event to the last record -
only.

Let me know.
"Albert D. Kallal" <pl********************@msn.com> wrote in message
news:Napec.85464$oR5.82460@pd7tw3no...
Try:

DoCmd.OpenForm "My-Form-Name", acNormal

docmd.gotorecord acDataForm, "My forname", acLast
--
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada
pl******************@msn.com
http://www.attcanada.net/~kallal.msn


Nov 12 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: Alain Guichaoua | last post by:
Good evening to all Here is my problem : I have a form with a subform. They are linked. When I open the form I would like the subform to reach its last record. I tried the method...
3
by: BLUE WATER | last post by:
Hi, I have managed to simplify my problem but can't seem to get this to work. I want to open up a form from a click event of another form, but not only open the form when the button is pressed...
1
by: feck | last post by:
I have a database with several tables, one of which is I use this to bring up a form so you can unlock the record (set by using a yes no box on the data input form to prevent unauthorised...
2
by: Robert | last post by:
I have a label on my form lblCount and the following code in my form for displaying a record count: Private Sub Form_Current() Me.RecordsetClone.Bookmark = Me.Bookmark Me!lblCount.Caption =...
6
by: dbuchanan | last post by:
VS2005 I've been reading all the help I can on the topic (MSDN, other) but I can't make sense of this. Desired behavior; The user is to choose from the displayed list of the databound combobox...
1
maxamis4
by: maxamis4 | last post by:
I want to find out what the last record is and the first how is this done in vb.net if eof and bof are gone?
3
by: mtczx232 | last post by:
I have form that have Datagridview. I want that grid stand on the last record when form open. then user can move down one line to add new record. I not find Property like current_index thet can be...
1
by: tian | last post by:
Hi could someone hel me with this dillema. In my current network setup, a certain Access Database(.mdb) File must be opened by two different people at the same time. At this moment in time if one...
0
by: PeterSummer | last post by:
Could someone answer a vb.net database question? what is a good way to code a form so that a user could navigate through a dataset ie: MoveFirst, MoveNext, MovePrevious, MoveLast, Update and...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
2
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

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.