
Please, Please, Please I need help working with dates
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
Quote:
>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?