Please, Please, Please I need help working with dates

Please, Please, Please I need help working with dates

Post by MSir » Sat, 03 Oct 1998 04:00:00



I trying to create a schedule program that will keep track of our firefighters
on a daily basis.  I have several text fields which are grouped for each
engine, ambulance, and truck etc.  One text field is reserved for the date.
I'm using vb5 and access97  with a datacontrol to to move back and forth
between dates and to add and delete dates.   I'm been able to set this program
up with a command button that lets me add our next work day (create a new day)
and keep track of which people are off on that date (by removing the names from
textboxes of people that are either on a scheduled day off or vacation day) The
program also adds the name of firefighters that are on duty on this new date
into the same textbox as the previous date and make visiable the names of those
firefighters returning from being off.    This program would be very useful
because it would speed up the time it takes to plan manpower schedules.  I'm
having a problem adding and deleting dates.  The date textbox is tied to the
data1control from access and I can't get the dates to sort out correctly.  I've
tried everything even tieing the datacontrol to a querydef to sort the dates.  
Again  I've been using Data1.Recordset.(Add and Delete)  Should I be doing
something different?  I need to move back and forth from date to date (record
to record) even after I add or delete a date.  Can anyone please help?

 
 
 

Please, Please, Please I need help working with dates

Post by Michae » Sat, 03 Oct 1998 04:00:00


I myself am not sure whats going on
however, even when I need to use the bound controls(which I hate)
I use a seperate db connection(variable) to do all my adds or deletes
the bound controls are memory intensive, hogs grrrr.

by using the db.execute(from a variable)
you only then need to do a datacontrol.refresh
and grid.refresh to redisplay them properly and you wont have
any problems.(none that I know of)

I am sorry I am a bit confused by the message.

--
Michael
Microsoft Corporation
Development is a State of Mind
Not a Job :-)
Why dont I give out my full name or
Microsoft email address
Take a guess :-)


>I trying to create a schedule program that will keep track of our
firefighters
>on a daily basis.  I have several text fields which are grouped for each
>engine, ambulance, and truck etc.  One text field is reserved for the date.
>I'm using vb5 and access97  with a datacontrol to to move back and forth
>between dates and to add and delete dates.   I'm been able to set this
program
>up with a command button that lets me add our next work day (create a new
day)
>and keep track of which people are off on that date (by removing the names
from
>textboxes of people that are either on a scheduled day off or vacation day)
The
>program also adds the name of firefighters that are on duty on this new
date
>into the same textbox as the previous date and make visiable the names of
those
>firefighters returning from being off.    This program would be very useful
>because it would speed up the time it takes to plan manpower schedules.
I'm
>having a problem adding and deleting dates.  The date textbox is tied to
the
>data1control from access and I can't get the dates to sort out correctly.
I've
>tried everything even tieing the datacontrol to a querydef to sort the
dates.
>Again  I've been using Data1.Recordset.(Add and Delete)  Should I be doing
>something different?  I need to move back and forth from date to date
(record
>to record) even after I add or delete a date.  Can anyone please help?


 
 
 

Please, Please, Please I need help working with dates

Post by Rob Cachi » Sun, 04 Oct 1998 04:00:00


Hi

It is hard to work out what is going

Just some comments that may help

Why are you not using a date field in your access table ??

If you want to change  a date something along the lines of

Dim Newdate as date
Data1.Recordset.Fields("Date") = Newdate

should do the trick

For the selection of the right records

Dim startdate as date
Dim enddate as date
Dim SQLstring as string

startdate = textbox1.text
enddate = textbox2.text

SQLstring = "SELECT field1,field2,field3 FROM table  " & _
                      "WHERE date BETWEEN  #" & startdate & "#   AND  #"  &
enddate & "#"

Data1.Recordset =  SQLstring
Data1.Refresh

Regards, Rob


>I trying to create a schedule program that will keep track of our
firefighters
>on a daily basis.  I have several text fields which are grouped for each
>engine, ambulance, and truck etc.  One text field is reserved for the date.
>I'm using vb5 and access97  with a datacontrol to to move back and forth
>between dates and to add and delete dates.   I'm been able to set this
program
>up with a command button that lets me add our next work day (create a new
day)
>and keep track of which people are off on that date (by removing the names
from
>textboxes of people that are either on a scheduled day off or vacation day)
The
>program also adds the name of firefighters that are on duty on this new
date
>into the same textbox as the previous date and make visiable the names of
those
>firefighters returning from being off.    This program would be very useful
>because it would speed up the time it takes to plan manpower schedules.
I'm
>having a problem adding and deleting dates.  The date textbox is tied to
the
>data1control from access and I can't get the dates to sort out correctly.
I've
>tried everything even tieing the datacontrol to a querydef to sort the
dates.
>Again  I've been using Data1.Recordset.(Add and Delete)  Should I be doing
>something different?  I need to move back and forth from date to date
(record
>to record) even after I add or delete a date.  Can anyone please help?