Solved

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

Posted on 2010-08-30
6
1,539 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
[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
  • 3
  • 2
6 Comments
 
LVL 75

Accepted Solution

by:
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform) 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
Industry Leaders: 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 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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…
Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
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 …
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…

691 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