S
Steve Schapel
JesZee,
There are a lot of date-related functions built in to Access, plus, as
you have seen, you can also make your own custom ones.
So, if I understand you correctly, how's this for an idea?...
Put your two textboxes on the form, with the Default Value of the DateTo
box set to GetDate() as we have already discussed.
Put two little Command Buttons next to the textboxes, one for 'Last
week' and one for '8 weeks'.
If you need to change the DateTo entry, you can, and then click the
button required to put the appropriate vcalue in the DateFrom box.
The code on the Click event of the 'Last week' button is like this...
Me.DateFrom = Me.DateTo - 7
The code on the Click event of the '8 weeks' button is like this...
Me.DateFrom = DateAdd("ww", -8, Me.DateTo)
As mentioned earlier, the Criteria for the date field in your query then
becomes...
Between [Forms]![Insert Date form]![DateFrom] And [Forms]![Insert Date
form]![DateTo]
I suppose from the way you write the dates like Sept 25 that you are in
the USA, right?
As for books, for the type of learning you are talking about, I would
certainly recommend "Building Access Applications" by John Viescas.
There are a lot of date-related functions built in to Access, plus, as
you have seen, you can also make your own custom ones.
So, if I understand you correctly, how's this for an idea?...
Put your two textboxes on the form, with the Default Value of the DateTo
box set to GetDate() as we have already discussed.
Put two little Command Buttons next to the textboxes, one for 'Last
week' and one for '8 weeks'.
If you need to change the DateTo entry, you can, and then click the
button required to put the appropriate vcalue in the DateFrom box.
The code on the Click event of the 'Last week' button is like this...
Me.DateFrom = Me.DateTo - 7
The code on the Click event of the '8 weeks' button is like this...
Me.DateFrom = DateAdd("ww", -8, Me.DateTo)
As mentioned earlier, the Criteria for the date field in your query then
becomes...
Between [Forms]![Insert Date form]![DateFrom] And [Forms]![Insert Date
form]![DateTo]
I suppose from the way you write the dates like Sept 25 that you are in
the USA, right?
As for books, for the type of learning you are talking about, I would
certainly recommend "Building Access Applications" by John Viescas.