PDA

View Full Version : What is the proper data type?



Jacob Hilderbrand
06-12-2006, 03:26 PM
Quick question here. Refering to this code:


Private Sub Form_BeforeInsert(Cancel As Integer)

Dim rs As Object
Dim Rep As String

Set rs = CurrentDb.OpenRecordset("TblVariables")

Do While Not rs.EOF
If rs(1) = "CurrentSalesRep" Then
Rep = rs(2)
Exit Do
End If
rs.MoveNext
Loop

SalesRep = Rep

Set rs = Nothing

End Sub


I would think that rs should be a RecordSet data type, but when I try to Dim it as RecordSet or New RecordSet the code errors out. Object works fine, but I would like to use the proper datatype.

Thanks

Norie
06-12-2006, 04:24 PM
DRJ

I think it might depend on whether you want to use DAO or ADO.

Jacob Hilderbrand
06-12-2006, 09:23 PM
How can I tell which one it is? This code is in an Access database and there is not a reference checked for either DAO or ADO.

Thanks