GoToRecord

E

Esperanza

Hello VBA experts !
I would like to use the GoToRecord method in my form.
But how can I find the record Number of my client ?
if I use : index = rstClient.absolutePosition
idex alway = 0

Thanks in advance !!
Esperanza !!
'---------------------------------------------------------------------------
--------------------

Set db = CurrentDb()
Set rstClient = db.OpenRecordset("SELECT * FROM rSDFFILE_SDFCLIENT WHERE
SDFCLI=" & intNoClient)

sql = "SELECT * FROM rSDFFILE_SDFCLIENT WHERE SDFCLI=" & intNoClient
If rstClient.RecordCount >= 1 Then

index = rstClient.absolutePosition

'DoCmd.GoToRecord acDataForm, "frmContratVente", acGoTo, index
 
M

Marshall Barton

Esperanza said:
Hello VBA experts !
I would like to use the GoToRecord method in my form.
But how can I find the record Number of my client ?
if I use : index = rstClient.absolutePosition
idex alway = 0

Thanks in advance !!
Esperanza !!
'---------------------------------------------------------------------------
--------------------

Set db = CurrentDb()
Set rstClient = db.OpenRecordset("SELECT * FROM rSDFFILE_SDFCLIENT WHERE
SDFCLI=" & intNoClient)

sql = "SELECT * FROM rSDFFILE_SDFCLIENT WHERE SDFCLI=" & intNoClient
If rstClient.RecordCount >= 1 Then

index = rstClient.absolutePosition

'DoCmd.GoToRecord acDataForm, "frmContratVente", acGoTo, index


I don't think you're even close with that approach. Check
Help for details on something more along these lines:

With Me.RecordsetClone
.FindFirst "SDFCLI=" & intNoClient
If Not .NoMatch Then
Me.Bookmark = .Bookmark
End If
End With
 

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