A
Afrosheen via AccessMonster.com
I have this code listed below where I want to change information in a field,
but it has to match the criteria. I don't know if I'm doing it correct. All
of it needs to be changed. For example:
Dim cn As ADODB.Connection, sql As String
10 Set cn = CurrentProject.AccessConnection
20 sql = "update tbl_roster set status = 'off day' where shift = 'B-
Days'" & "or shift = 'Day Shift'" & "or shift = 'Afternoon Shift'" & "or
shift = 'B-Nights' And Not (tbl_roster.archive) = true"
'************ Executes the ADODB commands ******
30 cn.Execute sql, , adCmdText + adExecuteNoRecords
40 Set cn = Nothing
What I need is line 20 to say "set status = off day". I need
B-Days,Day Shift, Afternoon Shift, and B-Nights changed but not if the
archive field = true.
My question is that with the "or shift = " will it do the above or when it
gets to that value will it kick me out?
I'm sorry about this question, but I'm confused.
Thanks for reading my post.
but it has to match the criteria. I don't know if I'm doing it correct. All
of it needs to be changed. For example:
Dim cn As ADODB.Connection, sql As String
10 Set cn = CurrentProject.AccessConnection
20 sql = "update tbl_roster set status = 'off day' where shift = 'B-
Days'" & "or shift = 'Day Shift'" & "or shift = 'Afternoon Shift'" & "or
shift = 'B-Nights' And Not (tbl_roster.archive) = true"
'************ Executes the ADODB commands ******
30 cn.Execute sql, , adCmdText + adExecuteNoRecords
40 Set cn = Nothing
What I need is line 20 to say "set status = off day". I need
B-Days,Day Shift, Afternoon Shift, and B-Nights changed but not if the
archive field = true.
My question is that with the "or shift = " will it do the above or when it
gets to that value will it kick me out?
I'm sorry about this question, but I'm confused.
Thanks for reading my post.