Any help would be greatly appreciated.
I'm trying to use the "Before Record Added" event in a Time_Card_Query.
I've created a field in the query called TCCID: EmployeeID+Campus+Month.
If the TCCID has been "authorized" in "QryAuthorizations" and has an AuthorizationCID (EmployeeID+Campus+Month), I would like it to be set so you can't add to that person's month's campus' data. Is this possible?
I'm very new to ASP and don't know how to do the custom code part.
The error given is:select * from QrySAuthorizations where AuthCID =''
<<< Record was NOT updated >>>
[Microsoft][ODBC Microsoft Access Driver]Error in row
Here's the code I was trying to use....
Function BeforeAdd(dict)
' Parameters:
' dict - Scripting.Dictionary object.
' Each field on the Add form represented as 'Field name'-'Field value' pair
'** Check if specific record exists ****
strSQLExists = "select * from QrySAuthorizations where AuthCID ='" & dict("TCCID") & "'"
set rsExists = CreateObject("ADODB.Recordset")
Response.write strSQLExists
rsExists.Open strSQLExists, dbConnection
if not rsExists.eof then
Response.write "This Campus/User/Month has already been authorized."
BeforeAdd=False
else
' if dont exist do something else
end if
rsExists.Close : set rsExists = Nothing
BeforeAdd = True
' set BeforeAdd to True if you like to proceed with adding new record
' set it to False in other case
End Function