473,699 Members | 2,713 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.GoToRecor d , , 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.GoToRecor d , , 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 23929
Try:

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

docmd.gotorecor d 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.co m> wrote in message
news:Napec.8546 4$oR5.82460@pd7 tw3no...
Try:

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

docmd.gotorecor d 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**********@n owhere.com> wrote in message
news:Ne******** ******@news04.b loor.is.net.cab le.rogers.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.co m> wrote in message
news:Napec.8546 4$oR5.82460@pd7 tw3no...
Try:

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

docmd.gotorecor d 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
17502
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 docmd.gotorecord aclast but i did not
3
3541
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 but also move to the last record. DoCmd.OpenForm "My-Form-Name", acNormal Opens the form with no problem.....
1
2361
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 tweaking once the record is completed). I would like to move to the last record but 10 to give the form 10 lines of the last entries, rather than one that is achieved by using goto record.... acLast
2
3619
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 = Me.RecordsetClone.AbsolutePosition + 1 End Sub It works fine until I page to the last record and I get:
6
2880
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 and the coresponding 'Id' from the lookup table is to be inserted into the field of the new record. I have two simple tables. "tblPerson" is the data table. The lookup
1
1221
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
3658
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 set to last record. How I do that?
1
3973
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 person opens the specific file, another person can't open the same time, because Access Locks the file in use. How can I prevent Access from doing that and how can I allow two different users to open the same file over a network at the same time?...
0
1698
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 Delete records and have an option to find a record. I have been able to figure out how to navigate both using bound and unbound controls. But I can't figure out how to do the Navigation and find a record at the same time. Do most people use one...
0
8623
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9054
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8939
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7778
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6545
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5879
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4390
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4637
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2015
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.