Hi, i want to do navigation button like first, previous, next and last using command button. When user click the first button, the first record in access must appear . I do using the coding below but it not going to first record , it goes to records in 288 row.
Private Sub cmdFirst_Click( )
' Open a connection.
Set conn = New ADODB.Connectio n
conn.Connection String = "Provider=Micro soft.Jet.OLEDB. 4.0; " & _
"Data Source=" & App.Path & "\Everspark2.md b"
conn.CursorLoca tion = adUseClient
'Open the Connection
conn.Open
'Define an SQL statement (asking for all columns of the Solicitor table)
sqlString = " SELECT * FROM Alternator"
'execute the SQL statement and put the resulting set of record in recordset variable
Set rs1 = conn.Execute(sq lString)
rs1.MoveFirst
GetFields
rs1.Close
conn.Close
End Sub
Private Sub GetFields()
' Places field data into the text boxes -
txtAltId1.Text = rs1.Fields(0).V alue
txtEversparkNo1 .Text = rs1.Fields(1).V alue
End Sub
Plz help me.Thanks in advance.
Private Sub cmdFirst_Click( )
' Open a connection.
Set conn = New ADODB.Connectio n
conn.Connection String = "Provider=Micro soft.Jet.OLEDB. 4.0; " & _
"Data Source=" & App.Path & "\Everspark2.md b"
conn.CursorLoca tion = adUseClient
'Open the Connection
conn.Open
'Define an SQL statement (asking for all columns of the Solicitor table)
sqlString = " SELECT * FROM Alternator"
'execute the SQL statement and put the resulting set of record in recordset variable
Set rs1 = conn.Execute(sq lString)
rs1.MoveFirst
GetFields
rs1.Close
conn.Close
End Sub
Private Sub GetFields()
' Places field data into the text boxes -
txtAltId1.Text = rs1.Fields(0).V alue
txtEversparkNo1 .Text = rs1.Fields(1).V alue
End Sub
Plz help me.Thanks in advance.
Comment