Solved

GoToRecord command

Posted on 1998-12-17
6
769 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…

749 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