RE: Increase time by set number of minutes

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Hi Paolo,

My Table is called Entries

Some Fields that will be used for calculations in table are

Entry #

Session

Time


So I would like it to find the first entry # in Session 1.
Then prompt me for a Time to start the session.
Then update all records in that particular session.

Then I could repeat it same procedure for

Session 2

Session 3

Session 4


Does that make sense to you?

I'm sorry I'm having such a hard time getting this. I truly appreciate your
help.






"Paolo" wrote:

Well, you said "I am not looking for it to automatically input the time when
adding a new record but instead fill in the time of entries already in the
database when I
set a start time for each catagory or ceremony."

I think the code I wrote do that.
In the form you specify the new start time and the category using this new
start time. I also included the number of minutes between the entries if you
wanna change it. So when you click the button the code update the field
containing the start time for each entry. I assume that you have them in a
table, isn't it? So in my sample I called it yourtable, obviously you must
substitute it with the real name of the table. Also the fields name were an
example and must be replaced with the real name (obviously if the structure
of the table where you store the data is like I imagined)
If you have a field called entry # enclose it between box brackets [entry #]
If I'm not 'nuff clear post the structure of the table you wanna update so
I'll use the real names of the fields and my code will be clearer.

Cheers Paolo

"S" wrote:

Hi Paolo,

I am still having problems. Let me explain a little better.

I have all the information including catagory numbers already filled in. The
only field not filled in is my "Time" field.

Are you saying I need another field other than "Time" one for "Start Time"
as well?

Could I also be having problems because my field is "Entry #" is the #
messing up the code?

"Paolo" wrote:

Hi S,
If I understood well your problem that should solve it:
let's say you have a form where you have 3 text box, one for the category
you wanna update called txt_category, one for the start time called
txt_start_time, and the third called num_min where you specify the number of
minutes between entries.
I call the table you wanna update yourtable where I assume there's a field
called for example category, another called entry and a third called start
containing the start time
Add to the form a button with this code

set rec=currentdb,openrecordset("select * from yourtable where category="""
& txt_category & """ order by entry",dbopendynaset)
num_entry=0
do while not rec.eof
rec.edit
rec!start=DateAdd("n", num_entry*num_min, txt_start_time)
rec.update
rec.movenext
num_entry=num_entry+1
loop
rec.close
msgbox "Update completed"

All this is aircode so you have to test it.

HTH Paolo

"S" wrote:

PLEASE IF ANYONE CAN HELP. I AM UNDER A DEADLINE.
THANK YOU!

"S" wrote:

I should mention - all entries are already entered into the database. I then
group them together by catagory and then manually assign it a catagory
number, an awards ceremony, and then an entry number.

I am not looking for it to automatically input the time when adding a new
record but instead fill in the time of entries already in the database when I
set a start time for each catagory or ceremony.



"TC Blue Boy" wrote:

Assume that you have a table with the time field defined as follows:
Field Name Data Type
EntryTime Date/Time - With Format of "Medium Time"

Also the Form has the EntryTime field on it but not updateable by the user.
Then create a "BeforeUpdate" event like so:

Private Sub Form_BeforeUpdate(Cancel As Integer)
Dim datLastTime As Date

If Form.NewRecord Then
If DCount("EntryTime", "Table1") > 0 Then
datLastTime = DMax("EntryTime", "Table1")
EntryTime = DateAdd("n", 4, datLastTime)
End If
End If
End Sub

This should do it.

==============================

"S" wrote:

I have created a database for running a competition.
I am now trying to automate making a schedule.
I am looking for access to input the time for each record for me to create a
schedule.

Say entry # 001 starts at 8:00AM and each entry is 4 minutes long.
how do i get access to automatically go to entry 002 and fill in the time as
8:04AM
entry 003 as 8:08AM etc etc.
.



Relevant Pages

  • RE: Increase time by set number of minutes
    ... I call the table you wanna update yourtable where I assume there's a field ... group them together by catagory and then manually assign it a catagory ... number, an awards ceremony, and then an entry number. ... I am now trying to automate making a schedule. ...
    (microsoft.public.access.modulesdaovba)
  • RE: Increase time by set number of minutes
    ... I have all the information including catagory numbers already filled in. ... I call the table you wanna update yourtable where I assume there's a field ... number, an awards ceremony, and then an entry number. ... I am now trying to automate making a schedule. ...
    (microsoft.public.access.modulesdaovba)
  • RE: Increase time by set number of minutes
    ... "Paolo" wrote: ... the start time for session 1. ... 'this recordset contains all the entries in the current session ordered ... So I would like it to find the first entry # in Session 1. ...
    (microsoft.public.access.modulesdaovba)
  • RE: Increase time by set number of minutes
    ... the start time for session 1. ... 'this recordset contains all the entries in the current session ordered ... So I would like it to find the first entry # in Session 1. ... I have all the information including catagory numbers already filled in. ...
    (microsoft.public.access.modulesdaovba)
  • RE: Increase time by set number of minutes
    ... the start time for session 1. ... 'this recordset contains all the entries in the current session ordered ... So I would like it to find the first entry # in Session 1. ... I have all the information including catagory numbers already filled in. ...
    (microsoft.public.access.modulesdaovba)