Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Modules / DAO / VBA / November 2006

Tip: Looking for answers? Try searching our database.

FindFirst Method syntax

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
boomer - 19 Nov 2006 22:22 GMT
Please help me to understand the syntax for the Recordset.Findfirst when
searching for a CustomerID field using a combo box.  First I declare an
Object variable with Dim, then assign a recordsetclone to the variable.  Then
I use the FindFirst method to synchronize the combo box with the first
instance of the record on the form with identical ID numbers.  But the
quotation marks and especially the ampersand are what confuse me.  I am using
Access 2000.
Can you help please.

Signature

Boomer

Ken Snell (MVP) - 19 Nov 2006 23:30 GMT
It'll be easier to provide explanations if you post the code that you have
right now. We then can provide suggestions for how to correct it if needed.

Signature

       Ken Snell
<MS ACCESS MVP>

> Please help me to understand the syntax for the Recordset.Findfirst when
> searching for a CustomerID field using a combo box.  First I declare an
[quoted text clipped - 6 lines]
> Access 2000.
> Can you help please.
Marshall Barton - 19 Nov 2006 23:47 GMT
>Please help me to understand the syntax for the Recordset.Findfirst when
>searching for a CustomerID field using a combo box.  First I declare an
[quoted text clipped - 3 lines]
>quotation marks and especially the ampersand are what confuse me.  I am using
>Access 2000.

The tried and true code sequence since A95 is:

If Me.Dirty Then Me.Dirty = False        'save any changes
With Me.RecordsetClone
    If .RecordCount > 0 Then
        .FindFirst "[name of number field] = " & Me.combo
'or    .FindFirst "[name of text field] = """ & Me.combo & """"
        If Not .NoMatch Then Me.Bookmark = .Bookmark
    End If
End With

Logically, this should work just as well in A2002 and A2003
(not sure about A2000)

If Me.Dirty Then Me.Dirty = False        'save any changes
With Me.Recordset
    If .RecordCount > 0 Then
        .FindFirst "[name of number field] = " & Me.combo
'or    .FindFirst "[name of text field] = """ & Me.combo & """"
    End If
End With

Signature

Marsh
MVP [MS Access]

davjoh123@yahoo.com - 20 Nov 2006 18:07 GMT
Could it be that FindFirst is a method of DAO and you do not have a
reference set to DAO?

> >Please help me to understand the syntax for the Recordset.Findfirst when
> >searching for a CustomerID field using a combo box.  First I declare an
[quoted text clipped - 25 lines]
>     End If
> End With
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.