G
Guest
I have a table where I want to change a date for all the records that have an
asterisk in a particular column. Here's my stab at the code:
Dim rst As New ADODB.Recordset
rst.Open "tblStaff", CurrentProject.Connection, adOpenDynamic,
adLockOptimistic
Do While Not rst.EOF
'If "![txtQual] = 'x'" Or "![txtQual] = 'X'" Then
'![datStartDate] = DateAdd("d", 1, Date)
'End If
Dim strSQL As String
strSQL = "UPDATE tblStaff " & _
"SET [datStartDate] = DateAdd(""d"", 1, Date) " & _
"WHERE [Qual] = 'x'or [txtQual] = 'X'" 'Date served
goes in table
CurrentDb.Execute strSQL, dbFailOnError
rst.MoveNext
Loop
I treid the "If" stmt first and then commented it out and tried the SQL
stmt. I'm sure this is probably not a hard problem. Thanks for any help
Nick
asterisk in a particular column. Here's my stab at the code:
Dim rst As New ADODB.Recordset
rst.Open "tblStaff", CurrentProject.Connection, adOpenDynamic,
adLockOptimistic
Do While Not rst.EOF
'If "![txtQual] = 'x'" Or "![txtQual] = 'X'" Then
'![datStartDate] = DateAdd("d", 1, Date)
'End If
Dim strSQL As String
strSQL = "UPDATE tblStaff " & _
"SET [datStartDate] = DateAdd(""d"", 1, Date) " & _
"WHERE [Qual] = 'x'or [txtQual] = 'X'" 'Date served
goes in table
CurrentDb.Execute strSQL, dbFailOnError
rst.MoveNext
Loop
I treid the "If" stmt first and then commented it out and tried the SQL
stmt. I'm sure this is probably not a hard problem. Thanks for any help
Nick