C
CJB
I've been using Access for many years. I usually create a module with
typical code:
Function MyFunction(user_name As String, groups As String) As String
Dim db As Database
Dim rs as Recordset
Set db = CurrentDb
Set rs = db.OpenQuery( etc. )
' Do calcs with field values, etc.
rs.Close
End Function
However I cannot get this to compile. It refuses to recognise:
Dim db As Database
In fact when I type in 'Dim db As' the keyword 'Database' is not even
offered in the menu.
Please what am I doing wrong. I think I have to set up Tools /
References - but which one out of hundreds? I have never had this
problem in the past but then I used Access 8. Now I have Access 9 and
seem to be having far more configuration issues.
Many thanks - CJB.
typical code:
Function MyFunction(user_name As String, groups As String) As String
Dim db As Database
Dim rs as Recordset
Set db = CurrentDb
Set rs = db.OpenQuery( etc. )
' Do calcs with field values, etc.
rs.Close
End Function
However I cannot get this to compile. It refuses to recognise:
Dim db As Database
In fact when I type in 'Dim db As' the keyword 'Database' is not even
offered in the menu.
Please what am I doing wrong. I think I have to set up Tools /
References - but which one out of hundreds? I have never had this
problem in the past but then I used Access 8. Now I have Access 9 and
seem to be having far more configuration issues.
Many thanks - CJB.