G
Guest
Newbie help needed
I'm trying to navigate a recordset and display the value of a field on a form as I navigate the recordset
I have one text box control (txtRandomID) on the form and a command button which calls the OnClick event below. My record opens fine and I seem to 'walk' the file okay... however the text box control remains empty and is not updated with the appropriate field value as the records change. What am I missing
Private Sub cmdADOTest_Click(
Dim rstImages As ADODB.Recordse
Dim lngCurrentRecordNumber As Lon
Dim lngCountTotalRecords As Lon
Set rstImages = New ADODB.Recordse
rstImages.Open "IMGCTRL", CurrentProject.Connection, adOpenStatic,
adLockReadOnl
MsgBox ("Recordset Opened"
Set Me.Recordset = rstImage
With rstImage
If .RecordCount > 0 The
.MoveFirs
Do Until .EO
Me.txtRandomID.Value = .Fields("RANDOMID"
.MoveNex
Loo
End I
.Clos
End Wit
MsgBox ("All Records Navigated"
Set rstImages = Nothin
End Sub
I'm trying to navigate a recordset and display the value of a field on a form as I navigate the recordset
I have one text box control (txtRandomID) on the form and a command button which calls the OnClick event below. My record opens fine and I seem to 'walk' the file okay... however the text box control remains empty and is not updated with the appropriate field value as the records change. What am I missing
Private Sub cmdADOTest_Click(
Dim rstImages As ADODB.Recordse
Dim lngCurrentRecordNumber As Lon
Dim lngCountTotalRecords As Lon
Set rstImages = New ADODB.Recordse
rstImages.Open "IMGCTRL", CurrentProject.Connection, adOpenStatic,
adLockReadOnl
MsgBox ("Recordset Opened"
Set Me.Recordset = rstImage
With rstImage
If .RecordCount > 0 The
.MoveFirs
Do Until .EO
Me.txtRandomID.Value = .Fields("RANDOMID"
.MoveNex
Loo
End I
.Clos
End Wit
MsgBox ("All Records Navigated"
Set rstImages = Nothin
End Sub