Trying to convert 97 to 2000 Form Coding HELP

G

Guest

Below is a piece of code behind a double click event on a Form where we are trying to use a cloned recordset to bring records from the clone to the main form.

MS 97 Vewrsion (It works!
Private Sub FindItem(

Dim rs As Recordset, sCriteria As Strin

With Forms![Main Menu]![Item Master].For
sCriteria = "[Record #] = " & Me![Record #
Set rs = .RecordsetClon
rs.FindFirst sCriteri
If Not rs.NoMatch The
.Bookmark = rs.Bookmar
End I
End Wit
DoCmd.Close acForm, Me.Nam

End Su

MS 2000 (Does Not Work

Private Sub FindItem(

Dim rs As DAO.Recordse
Dim sCriteria As Strin
With Forms![Main Menu]![Item Master].For
sCriteria = "[Record #] = " & Me![Record #
Set rs = Me.Recordset.Clon
rs.Find "[Record #]= " & sCriteri

rs.Clos
End Wit
DoCmd.Close acForm, Me.Nam

End Su
 
K

Kelvin

sCriteria = "[Record #] = " & Me![Record #]
rs.Find "[Record #]= " & sCriteria

These 2 lines are repeating "[Record #].

Kelvin

David said:
Below is a piece of code behind a double click event on a Form where we
are trying to use a cloned recordset to bring records from the clone to the
main form.
MS 97 Vewrsion (It works!)
Private Sub FindItem()

Dim rs As Recordset, sCriteria As String

With Forms![Main Menu]![Item Master].Form
sCriteria = "[Record #] = " & Me![Record #]
Set rs = .RecordsetClone
rs.FindFirst sCriteria
If Not rs.NoMatch Then
.Bookmark = rs.Bookmark
End If
End With
DoCmd.Close acForm, Me.Name

End Sub


MS 2000 (Does Not Work)

Private Sub FindItem()

Dim rs As DAO.Recordset
Dim sCriteria As String
With Forms![Main Menu]![Item Master].Form
sCriteria = "[Record #] = " & Me![Record #]
Set rs = Me.Recordset.Clone
rs.Find "[Record #]= " & sCriteria

rs.Close
End With
DoCmd.Close acForm, Me.Name

End Sub
 
P

Pavel Romashkin

Could it have anything to do with the extra "." in "Recordset.Clone" in
the A2000 version?

Pavel
 
T

TC

Urk!

Say:

With Me.Recordsetclone
.FindFirst "[Record #] = " & Me![Record #]
If Not .NoMatch Then
me.Bookmark = .Bookmark
End If
End With

HTH,
TC


David said:
Below is a piece of code behind a double click event on a Form where we
are trying to use a cloned recordset to bring records from the clone to the
main form.
MS 97 Vewrsion (It works!)
Private Sub FindItem()

Dim rs As Recordset, sCriteria As String

With Forms![Main Menu]![Item Master].Form
sCriteria = "[Record #] = " & Me![Record #]
Set rs = .RecordsetClone
rs.FindFirst sCriteria
If Not rs.NoMatch Then
.Bookmark = rs.Bookmark
End If
End With
DoCmd.Close acForm, Me.Name

End Sub


MS 2000 (Does Not Work)

Private Sub FindItem()

Dim rs As DAO.Recordset
Dim sCriteria As String
With Forms![Main Menu]![Item Master].Form
sCriteria = "[Record #] = " & Me![Record #]
Set rs = Me.Recordset.Clone
rs.Find "[Record #]= " & sCriteria

rs.Close
End With
DoCmd.Close acForm, Me.Name

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top