Solved

GoToRecord command

Posted on 1998-12-17
6
764 Views
Last Modified: 2010-05-18
I am jumping from one form to another using:

    DoCmd.GoToRecord acDataForm, "ViewInvoices", acGoTo, 2

but instead of going to record number 2 I want to go to the same record that I am already in. acNext  - ok,  acPrevious - ok ... but I want to go to the very same record.
What is this command?!!!

Cheers.

0
Comment
Question by:englishman
6 Comments
 
LVL 7

Expert Comment

by:smilitaru
ID: 1971358
Please, be less confusing.
If you don't know to go from current record you have no need to use GoToRecord command, or if You want to use try with
DoCmd.GoToRecord acDataForm, "ViewInvoices", acGoTo, 0
0
 
LVL 2

Author Comment

by:englishman
ID: 1971359
DoCmd.GoToRecord acDataForm, "ViewInvoices", acGoTo, 0
0 is an invalid value.

I was using:

    Dim stLinkCriteria As String

    stDocName = "ViewInvoices"
   
    stLinkCriteria = "[InvoiceNo]=" & Me![InvoiceNo]
    DoCmd.OpenForm stDocName, , , stLinkCriteria

But the trouble with this is that it filters the records.
0
 
LVL 7

Expert Comment

by:spiridonov
ID: 1971360
You need to use 'Bookmark' property of the Form record source.
0
Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

 
LVL 12

Expert Comment

by:Trygve
ID: 1971361
Or:
forms!OtherForm!InvoiceNo.setfocus
DoCmd.FindRecord me!InvoiceNo

The bookmark approach is more elegant (even if it takes more code to do it), but often considered a bit confusing by non-expert programmers
0
 
LVL 2

Author Comment

by:englishman
ID: 1971362
You are both more elegant than me, and Trygve takes the points.
Excellent.
0
 
LVL 12

Accepted Solution

by:
Trygve earned 10 total points
ID: 1971363
OK then.

Happy christmas seasons !
Trygve
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction When developing Access applications, often we need to know whether an object exists.  This article presents a quick and reliable routine to determine if an object exists without that object being opened. If you wanted to inspect/ite…
I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now