Solved

How to Go To Specific record on Access form using VBA on Unbound control

Posted on 2010-08-30
6
1,512 Views
Last Modified: 2012-05-10
On my Access form, instead of using the "Navigation Buttons" property turned On, I am creating my own controls for Navigation. In order to display the current record that user is on, I have a text box "txtCurrentRecordNo" on the form whose Control Source is set as '=[CurrentRecord]'. In the native Access Record Navigator, if user types in a number in the textbox & presses ENTER, the form moves to that specific record #. I want to replicate the same functionality but my textbox txtCurrentRecordNo does NOT allow me to type anything in it. How do I replicate that functionalty?
0
Comment
Question by:datasolutionz
  • 3
  • 2
6 Comments
 
LVL 75

Accepted Solution

by:
DatabaseMX (Joe Anderson - Access MVP) earned 50 total points
ID: 33564399
Have you seen this (free):

http://www.lebans.com/recnavbuttons.htm

mx
0
 
LVL 10

Expert Comment

by:t_hungate
ID: 33572329
I think you are going to have to supply some more info on this one.  What is the primary key of your table?  Does each record have an associated number or autonumber assigned to it?  If so, you don't need to use the =[CurretnRecord] at all.  Just display the primary key, and give that field and after update event to look up and display the fields current value as current record.

TLh
0
 

Author Comment

by:datasolutionz
ID: 33615238
DatabaseMX - The above solution is good, but I THINK there is a flaw. if user clicks on the NEW record button to start a new record, that button remains disabled even after the user has entered some data on the form. Normally, as soon as any data is entered on a NEW record, that record is no longer new & the NEW record button should no longer be disabled. Any thoughts around solution? I would think that somehow determine if the Form is Dirty...but I dont know how to imlplement that. Your genius thoughts are anticipated :-)
0
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 
LVL 75
ID: 33615532
Haven't looked at that code for a long time.

However, you could use the Form Dirty event to enable the New Record button as soon as the record becomes Dirty.

See attached screen shot.

mx

Capture1.gif
0
 

Author Comment

by:datasolutionz
ID: 33619275
Thanks MX....that works well!
0
 
LVL 75
ID: 33619629
No doubt a small oversight on Leban's part :-)

And a good catch on your part !

mx
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Suggested Solutions

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…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
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…

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

15 Experts available now in Live!

Get 1:1 Help Now