S
Scott Whetsell, A.S. - WVSP
Using the code below, I am getting Error 3464 on the line that looks up the
CCNo value. The code works fine on my computer running Vista SP1 / Office
2003 SP3 but will not run on the front line comptuers running XP Pro SP3 /
Office 2003 SP3.
====== CODE STARTS HERE ======
Function mcr_SafetyTimerReset()
Dim dbs As Database
Dim rst As DAO.Recordset
Dim strSQL As String
strSQL = "SELECT tbl_OrganizationMembers.OM_Timer,
tbl_OrganizationMembers.OM_Expiration, tbl_OrganizationMembers.OM_UnitID " & _
"FROM tbl_OrganizationMembers " & _
"WHERE (((tbl_OrganizationMembers.OM_Timer) = ""ON"") And
((tbl_OrganizationMembers.OM_Expiration) <= Now())) " & _
"ORDER BY tbl_OrganizationMembers.OM_Expiration"
Set dbs = CurrentDb
Set rst = dbs.OpenRecordset(strSQL)
If rst.EOF = True Then GoTo Exit_Function_STR
Dim CCNo As Variant
Dim EVCD As Variant
Dim UNIT As String
UNIT = Nz(DLookup("AssignedUnit", "qry_AssignedUnit", "[OM_UnitID]='" &
rst.Fields(2) & "'"), rst.Fields(2))
CCNo = DLookup("UL_CCNo", "qry_UnitSts2", "[Unit]='" & rst.Fields(2) & "'")
'<---
EVCD = DLookup("EventCode", "tbl_CCNo", "[CCNo]='" & CCNo & "'")
Call unitLog(CCNo, UNIT, "10-4", "10-50", EVCD)
Exit_Function_STR:
Set dbs = Nothing
Set rst = Nothing
Exit Function
End Function
====== CODE ENDS HERE======
Code fails on line indicated with '<---
Fields Defined:
OM_Timer Text "ON" / "OFF" / "" Values only
OM_Expiration Date/Time yyyy-mm-dd hh:nn:ss
OM_UnitID Text 3 - 6 AlphaNumeric Characters incl
hyphens
EVENTCODE Text 3 - 6 AlphaNumeric Characters
CCNo fields Text 11 Characters formatted yyyy-000000
AssignedUnit Text 3 - 50 AlphaNumeric Chars incl
hypens and space
This function is in an Autokeys module. The recordset generally will not
have more than one record at a time, but if there is, it should select the
oldest record first. unitLog is another function which should have no effect
on this function.
Thanks for any assistance.
CCNo value. The code works fine on my computer running Vista SP1 / Office
2003 SP3 but will not run on the front line comptuers running XP Pro SP3 /
Office 2003 SP3.
====== CODE STARTS HERE ======
Function mcr_SafetyTimerReset()
Dim dbs As Database
Dim rst As DAO.Recordset
Dim strSQL As String
strSQL = "SELECT tbl_OrganizationMembers.OM_Timer,
tbl_OrganizationMembers.OM_Expiration, tbl_OrganizationMembers.OM_UnitID " & _
"FROM tbl_OrganizationMembers " & _
"WHERE (((tbl_OrganizationMembers.OM_Timer) = ""ON"") And
((tbl_OrganizationMembers.OM_Expiration) <= Now())) " & _
"ORDER BY tbl_OrganizationMembers.OM_Expiration"
Set dbs = CurrentDb
Set rst = dbs.OpenRecordset(strSQL)
If rst.EOF = True Then GoTo Exit_Function_STR
Dim CCNo As Variant
Dim EVCD As Variant
Dim UNIT As String
UNIT = Nz(DLookup("AssignedUnit", "qry_AssignedUnit", "[OM_UnitID]='" &
rst.Fields(2) & "'"), rst.Fields(2))
CCNo = DLookup("UL_CCNo", "qry_UnitSts2", "[Unit]='" & rst.Fields(2) & "'")
'<---
EVCD = DLookup("EventCode", "tbl_CCNo", "[CCNo]='" & CCNo & "'")
Call unitLog(CCNo, UNIT, "10-4", "10-50", EVCD)
Exit_Function_STR:
Set dbs = Nothing
Set rst = Nothing
Exit Function
End Function
====== CODE ENDS HERE======
Code fails on line indicated with '<---
Fields Defined:
OM_Timer Text "ON" / "OFF" / "" Values only
OM_Expiration Date/Time yyyy-mm-dd hh:nn:ss
OM_UnitID Text 3 - 6 AlphaNumeric Characters incl
hyphens
EVENTCODE Text 3 - 6 AlphaNumeric Characters
CCNo fields Text 11 Characters formatted yyyy-000000
AssignedUnit Text 3 - 50 AlphaNumeric Chars incl
hypens and space
This function is in an Autokeys module. The recordset generally will not
have more than one record at a time, but if there is, it should select the
oldest record first. unitLog is another function which should have no effect
on this function.
Thanks for any assistance.