S
S
I have created a database for a competition.
I have a table called
Entries
I have fields called
Entry #
Session
Time
Each Entry # is assigned a Session (1-5). So I am looking to create an
update button in a form to assign a time for each entry #.
So It would find the first entry # in Session 1 and ask me for the Time
(lets say 9:00AM). Based on that time and that each routine is 4 minutes
long, it would automatically update the times for the rest of the entry #’s.
So entry # 002 would now have 9:04AM in the time field
Entry # 003 would now have 9:08AM in the time field.
Etc etc
This is a code someone gave me but I keep getting error message.
Set rec_ses = CurrentDb.OpenRecordset("select session from entries group by
session order by session", dbOpenDynaset)
Do While Not rec_ses.EOF
'you specify the start time for the session in the input box
strt_tm = InputBox("Specify the start time for " & rec_ses!session)
'this recordset contains all the entries in the current session ordered
by entries
Set rec = CurrentDb.OpenRecordset("select * from entries where
session=""" & rec_ses!session & """ order by [entry #]", dbOpenDynaset)
num_entry = 0
Do While Not rec.EOF
rec.Edit
rec!Time = DateAdd("n", num_entry * 4, strt_tm)
rec.Update
rec.MoveNext
num_entry = num_entry + 1
Loop
rec.Close
'you goto next session
rec_ses.MoveNext
Loop
rec_ses.Close
MsgBox "Update completed"
I keep getting runtime error '3464'
data type mismatch in criteria expression
on debugging this highlights
Set rec = CurrentDb.OpenRecordset("select * from entries where session=""" &
rec_ses!Session & """ order by entry", dbOpenDynaset)
Any help would be greatly appreciated. But stuck on this for days.
I have a table called
Entries
I have fields called
Entry #
Session
Time
Each Entry # is assigned a Session (1-5). So I am looking to create an
update button in a form to assign a time for each entry #.
So It would find the first entry # in Session 1 and ask me for the Time
(lets say 9:00AM). Based on that time and that each routine is 4 minutes
long, it would automatically update the times for the rest of the entry #’s.
So entry # 002 would now have 9:04AM in the time field
Entry # 003 would now have 9:08AM in the time field.
Etc etc
This is a code someone gave me but I keep getting error message.
Set rec_ses = CurrentDb.OpenRecordset("select session from entries group by
session order by session", dbOpenDynaset)
Do While Not rec_ses.EOF
'you specify the start time for the session in the input box
strt_tm = InputBox("Specify the start time for " & rec_ses!session)
'this recordset contains all the entries in the current session ordered
by entries
Set rec = CurrentDb.OpenRecordset("select * from entries where
session=""" & rec_ses!session & """ order by [entry #]", dbOpenDynaset)
num_entry = 0
Do While Not rec.EOF
rec.Edit
rec!Time = DateAdd("n", num_entry * 4, strt_tm)
rec.Update
rec.MoveNext
num_entry = num_entry + 1
Loop
rec.Close
'you goto next session
rec_ses.MoveNext
Loop
rec_ses.Close
MsgBox "Update completed"
I keep getting runtime error '3464'
data type mismatch in criteria expression
on debugging this highlights
Set rec = CurrentDb.OpenRecordset("select * from entries where session=""" &
rec_ses!Session & """ order by entry", dbOpenDynaset)
Any help would be greatly appreciated. But stuck on this for days.