the following is a vba query that is to null fields, however, the fields are NOT being null out.
any suggestions would be appreciate.
the code is as follows:
any suggestions would be appreciate.
the code is as follows:
Code:
Private Sub Update_Pending_Rec_Dates()
On Error GoTo Err_Hndlr
'**********************************************
Dim dbs As Database
Dim strSQL As String
Dim strQueryName As String
Dim qryDef As QueryDef
'set variable values
Set dbs = CurrentDb
strQueryName = "sql_Update_Pending_Rec_Dates"
'Delete old query first - we want fresh data!
dbs.QueryDefs.Delete strQueryName
'Notice below how we inserted the variable as a parameter value - Visual Basic will evaluate strMonth and insert the value for us.
strSQL = "UPDATE ContractImport SET ContractImport.Active = Null, ContractImport.EffectiveDate = Null, ContractImport.ExpirationDate = Null, ContractImport.RenewalsRemaining = Null, ContractImport.[End of Contract Status] = Null WHERE (((ContractImport.[Contract Status]) Like 'pending%'));"
'Create query definition
Set qryDef = dbs.CreateQueryDef(strQueryName, strSQL)
Update_Pending_Rec_Dates_Exit:
Exit Sub
Err_Hndlr:
MsgBox "[" & Err.Number & "]: " & Err.Description, vbInformation, "Update_Pending_Rec_Dates()"
End Sub
Comment