Results 1 to 5 of 5
  1. #1
    kman42 is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Mar 2011
    Posts
    40

    Allow new records, but don't show new at end?

    I want to allow my users to click a button to enter a new record, but I don't want them to be able to navigate to a new record by clicking the forward button. If I set Allow Additions to false, then it gets rid of the blank record at the end of the set, but they can't add a record even by expressly pressing the Add button.

    I tried to switch Allow Additions to true in VBA when they press the button, but if I switch it back at the end of the sub then the new record disappears before the use has a chance to add anything. Do I need to do a save record or something?

    Any suggestions?

  2. #2
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    If you remove the default navigation buttons and put in your own button you can set the CYCLE property of the form to CURRENT RECORD, then when they hit enter or tab after the last field or object on your form it will go back to the first field of the form. Then the only way they can get to an new record is for them to click your 'new record' button.

  3. #3
    kman42 is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Mar 2011
    Posts
    40
    I have my own navigation buttons, I'm just not sure how to prevent the forward button from going to the 'new' record when they are at the end of the record set.

  4. #4
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    is there any possibility of you uploading a copy of your database with bogus data. Your use of terminology is not making sense to me and it would be far easier if I could see an example. Just create a copy of your database (access 2003 or below please), purge any sensitive information and put in enough fake data for your example to work then zip it up and attach it to a post.

  5. #5
    kman42 is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Mar 2011
    Posts
    40
    The following solved my problem:

    Private sub CmdNext_Click()
    With Recordset
    If .AbsolutePosition = .RecordCount - 1 Then
    'you are on the last record
    MsgBox "Sorry, this is the last Record.", vbInformation
    Else
    'you are on some other record
    DoCmd.GoToRecord , , acNext
    End If
    End With
    End Sub

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

Similar Threads

  1. Show records for each date
    By cooper in forum Forms
    Replies: 2
    Last Post: 08-11-2011, 08:58 AM
  2. Replies: 4
    Last Post: 07-28-2011, 06:57 AM
  3. Replies: 5
    Last Post: 06-13-2011, 01:30 PM
  4. Show only some records in Form View
    By Douglasrac in forum Forms
    Replies: 3
    Last Post: 05-15-2011, 11:01 AM
  5. Show all records.
    By dennisvillareal in forum Access
    Replies: 1
    Last Post: 03-03-2011, 04:28 PM

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