G
GY2
The following code won't run for me in an Access module apparently because J
is dimmed As Byte. The code runs fine with J As Integer or As Variant. Just
curious but is this right?
Sub RecordsetTest()
Dim J As Byte
Dim rs As adodb.recordset
Dim cnn As adodb.Connection
Set rs = New adodb.recordset
Set cnn = CurrentProject.Connection
rs.Open "tblWhatever", cnn
Let J = 2
Debug.Print rs(2)
Debug.Print rs(J) 'This will blowup with Dim J as Byte
End Sub
is dimmed As Byte. The code runs fine with J As Integer or As Variant. Just
curious but is this right?
Sub RecordsetTest()
Dim J As Byte
Dim rs As adodb.recordset
Dim cnn As adodb.Connection
Set rs = New adodb.recordset
Set cnn = CurrentProject.Connection
rs.Open "tblWhatever", cnn
Let J = 2
Debug.Print rs(2)
Debug.Print rs(J) 'This will blowup with Dim J as Byte
End Sub