Solved

GoToRecord command

Posted on 1998-12-17
6
763 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
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 
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

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Join & Write a Comment

Most if not all databases provide tools to filter data; even simple mail-merge programs might offer basic filtering capabilities. This is so important that, although Access has many built-in features to help the user in this task, developers often n…
Today's users almost expect this to happen in all search boxes. After all, if their favourite search engine juggles with tens of thousand keywords while they type, and suggests matching phrases on the fly, why shouldn't they expect the same from you…
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…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

746 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

8 Experts available now in Live!

Get 1:1 Help Now