Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Use of bookmarks in form recordsetclone

Status
Not open for further replies.

DevelopV

Technical User
Mar 16, 2012
113
ZA
I have never used bookmarks!
I want to create a recordset clone on a form, loop though each record and verify data entry.
This is what I have:
Code:
Set rstForm = Me.RecordsetClone

With rstForm
    .MoveLast
    .MoveFirst
    
    Do Until .EOF
        If IsNull(Me.cboSalesAreaId) Or Me.cboSalesAreaId = "" Then
            MsgBox "Please enter the ""Sales Area"" for customer """ & rstForm!CustomerName & ".", vbExclamation, "No Sales Area"
            GoTo Exit_cmdClose_Click
        End If
        
        If IsNull(Me.cboDriverId) Or Me.cboDriverId = "" Then
            MsgBox "Please enter the ""Driver"" for customer """ & rstForm!CustomerName & ".", vbExclamation, "No Driver"
            GoTo Exit_cmdClose_Click
        End If
                     
        .MoveNext
    Loop
End With

How do I use bookmarks to ensure that each record is reported? The msgbox should show the name of the customer for the record being checked.

Many thanks in advance
 
As you test Me.XXX don't use RecordsetClone but Recordset ...

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
How do I use bookmarks to ensure that each record is reported?
Why do you think you need to use bookmarks, and what do you think they do? I have built thousands of Access database applications and never used a bookmark, and definitely not for verifying data. Cannot see any need here.
 
As MajP said, Bookmarks are not used for verifications, but typically to 'mark' a Record, if you will, do something, and then return to that 'marked' Record. Requerying a Form causes Access to move back to the first Record in the RecordSet, which is undesirable, at times, so you'd could do something like
Code:
Dim MyBookmark As Variant

MyBookmark = Me.Recordset.Bookmark

Me.Requery

Me.Recordset.Bookmark = MyBookmark

This would note the Current Record, do the Requery, then return to that same Record.

The Missinglinq

Richmond, Virginia

The Devil's in the Details!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top