Solved

GoToRecord command

Posted on 1998-12-17
6
766 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
Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

 
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

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

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

Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

776 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