Results 1 to 6 of 6
  1. #1
    jnrussell is offline Novice
    Windows 7 64bit Access 2003
    Join Date
    Feb 2014
    Posts
    17

    Why do I now have to click twice on navigation button

    For some reason I have to press PgDn twice or click on the navigation button at the bottom of the screen on my data entry form twice every time I want to go to the next record. What could be causing this?

  2. #2
    jnrussell is offline Novice
    Windows 7 64bit Access 2003
    Join Date
    Feb 2014
    Posts
    17
    More information on my question. I discovered this only happens when I have the following code entered for the field just prior to the AQID field:

    Private Sub Date_received_LostFocus()


    AQId.Value = "AQ" & Format(Str([RecId]), "00000")


    End Sub

    The field RecId is an autonumber field. The code puts the value above into the AQId field so the user doesn't have to enter it manually. It works, but for some reason it causes me to have to press PgDn twice or click on the navigation key twice to go to the next record. What am I doing wrong?

  3. #3
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows XP Access 2003
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,614
    Just a hunch, but what happens if you use:

    AQId.Value = "AQ" & Format(Str([RecId]), "00000")
    Me.Dirty = False
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    The Str() function is not necessary, although it shouldn't hurt.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    jnrussell is offline Novice
    Windows 7 64bit Access 2003
    Join Date
    Feb 2014
    Posts
    17
    The code you suggested might have worked, but before I saw your post I tried moving my code from the Lost Focus of the previous field to the Got Focus of its own field. My problem disappeared. I was just trying to make the field not a tab stop so the user wouldn't even have to go to that field and try to change the value on their own. I'm sure there's another way to prevent someone from changing the value but I'll keep working on that. If you have a suggestion for that I'd appreciate it. Thanks for taking the time to offer your suggestion.

  6. #6
    jnrussell is offline Novice
    Windows 7 64bit Access 2003
    Join Date
    Feb 2014
    Posts
    17
    I wanted to let you know I changed my code back to the Lost Focus of the previous field, added your line of code (Me.Dirty - False), the changed the AQId field to not be a tab stop and to be locked. Now my original problem is solved plus the user can't change the value in the field. Thank you so much for this suggestion. It was right on!

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 2
    Last Post: 10-28-2013, 06:39 PM
  2. Trying to click a button in vba
    By boywonder in forum Programming
    Replies: 8
    Last Post: 05-02-2011, 04:34 AM
  3. +1 on button click
    By 10 Gauge in forum Forms
    Replies: 4
    Last Post: 02-14-2011, 06:51 AM
  4. Command button click event
    By R_jang in forum Programming
    Replies: 10
    Last Post: 10-29-2010, 10:13 PM
  5. Increment a value on button click
    By michaeljohnh in forum Programming
    Replies: 9
    Last Post: 08-25-2010, 10:01 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums