Results 1 to 3 of 3
  1. #1
    Ruegen's Avatar
    Ruegen is offline VIP
    Windows 8 Access 2010 64bit
    Join Date
    Jul 2013
    Location
    Australia
    Posts
    1,496

    Move next unless record is matching then skip

    I want users to skip a record if it is open using another form

    so far I have it that if it matches the id of the other form I get a true result in which case I want it to skip the current record by moving to the next or previous or close if there is only one record shown on the form

    I'm not sure how to do this



    can I use Me.Recordset.MoveNext but have it do the tasks described if it has reached the final record ?

  2. #2
    Ruegen's Avatar
    Ruegen is offline VIP
    Windows 8 Access 2010 64bit
    Join Date
    Jul 2013
    Location
    Australia
    Posts
    1,496
    I am using...
    Code:
    'checkto see if school is already open on another form
    If cycleFoundSchools(Me.NewSchoolsID, Me.Form.Name) Then
        If Me.Recordset.EOF Then
            If Me.Recordset.BOF Then
            MsgBox "You have this record open and you only have a recordset of 1 so the form will now close"
            DoCmd.Close
            Else
            MsgBox "You have this record open already in another record, moving to the previous record"
            Me.Recordset.MovePrevious
            End If
        Else
        MsgBox "You have this record open already in another record, moving next record"
        Me.Recordset.MoveNext
        End If
    End If
    but I could be wrong, it seems to be working fine.

    Actually the problem now with the above code that if there is more than one record in a set, it moves forward skipping it but if I move backwards it moves forward so not sure how to get around.

    Basically if I move forward or backwards I want to "skip" the record - not sure how.
    Last edited by June7; 09-02-2014 at 11:23 PM.

  3. #3
    Ruegen's Avatar
    Ruegen is offline VIP
    Windows 8 Access 2010 64bit
    Join Date
    Jul 2013
    Location
    Australia
    Posts
    1,496
    Derp... Anyone?

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

Similar Threads

  1. Replies: 5
    Last Post: 06-16-2013, 05:25 PM
  2. Replies: 1
    Last Post: 05-07-2013, 11:02 AM
  3. Replies: 19
    Last Post: 06-05-2012, 08:19 AM
  4. Replies: 8
    Last Post: 05-05-2012, 02:01 PM
  5. Replies: 1
    Last Post: 04-10-2012, 06:00 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