Hi
I have the following code pulling data from a table onto a form. The db was devloped in Access 2003 in 2000 format and runs fine on 2000. However, when in '97, I get an error on the line 'Set cnn = CurrentProject.Connection'
I gather that CurrentProject is not available in '97 but is there a workaround?
Thanks in advance
I have the following code pulling data from a table onto a form. The db was devloped in Access 2003 in 2000 format and runs fine on 2000. However, when in '97, I get an error on the line 'Set cnn = CurrentProject.Connection'
I gather that CurrentProject is not available in '97 but is there a workaround?
Thanks in advance
Code:
Dim rs As New ADODB.Recordset
Dim cnn As ADODB.Connection
Dim strUser as String
Set cnn = CurrentProject.Connection
rs.Open "tblUsers", cnn, 3, 3
strUser = Environ("UserName")
With rs
.Find "User_Name = '" & strUser & "'"
Me.Text629.Value = !Admin.Value
Me.Text85.Value = !FullName.Value
Me.Text562.Value = !Entitlement.Value
Me.Text569.Value = !Remaining.Value
Me.Text575.Value = !TOIL.Value
Me.Text734.Value = !StaffID
End With
rs.Close
Set cnn = Nothing
Set rs = Nothing