26 txt boxes and date ranges

G

Guest

I have a predetermined amount of txt boxes on a report (26 to be exact). on
the form I have two txt boxes one called "txtFrom" and The other called
"txtTo".
Wha t I want to do is to enter two dates not to exceed 26 months from the
"txtFrom", upon clicking on the preview report "cmdPreview" I would like to
see only those months within the from and to dates.

So far I have settled for only propagating 26 months from the "txtFrom"
date. The formula is the following:

=DateSerial(Year([txtDateA]),Month([txtDateA])+1,Day([txtDateA]))
=DateSerial(Year([txtDateB]),Month([txtDateB])+1,Day([txtDateB]))
and so on 25 times (cause the first date's control source is "txtFrom")
This formula does not take into consideration the date found on "txtTo" to
regulate when to stop.

If I put in the txtFrom the date of 01/01/05 and in the txtTo the date of
05/01/05, I want for only those first 5 txt boxes in the report to display
the date range and leave the remaining 21 blank.

Any suggestions as to how to go about this, I ran out of think juice.
Thanks
 
W

Wolfgang Kais

Hi Memphis.

Memphis said:
I have a predetermined amount of txt boxes on a report (26 to be exact).
on the form I have two txt boxes one called "txtFrom" and The other
called "txtTo".
What I want to do is to enter two dates not to exceed 26 months from
the "txtFrom", upon clicking on the preview report "cmdPreview" I would
like to see only those months within the from and to dates.

So far I have settled for only propagating 26 months from the "txtFrom"
date. The formula is the following:

=DateSerial(Year([txtDateA]),Month([txtDateA])+1,Day([txtDateA]))
=DateSerial(Year([txtDateB]),Month([txtDateB])+1,Day([txtDateB]))
and so on 25 times (cause the first date's control source is "txtFrom")
This formula does not take into consideration the date found on
"txtTo" to regulate when to stop.

If I put in the txtFrom the date of 01/01/05 and in the txtTo the date
of 05/01/05, I want for only those first 5 txt boxes in the report to
display the date range and leave the remaining 21 blank.

Any suggestions as to how to go about this, I ran out of think juice.
Thanks

So how about this:
=Iif(DateAdd("m",1,[txtDateA])<=[txtTo],DateAdd("m",1,[txtDateA]),NULL)
=Iif(DateAdd("m",1,[txtDateB])<=[txtTo],DateAdd("m",1,[txtDateB]),NULL)
....
 
G

Guest

Thanks Wolfgang for taking your time to reply to my question, I'll give it a
try.

Dax


Wolfgang Kais said:
Hi Memphis.

Memphis said:
I have a predetermined amount of txt boxes on a report (26 to be exact).
on the form I have two txt boxes one called "txtFrom" and The other
called "txtTo".
What I want to do is to enter two dates not to exceed 26 months from
the "txtFrom", upon clicking on the preview report "cmdPreview" I would
like to see only those months within the from and to dates.

So far I have settled for only propagating 26 months from the "txtFrom"
date. The formula is the following:

=DateSerial(Year([txtDateA]),Month([txtDateA])+1,Day([txtDateA]))
=DateSerial(Year([txtDateB]),Month([txtDateB])+1,Day([txtDateB]))
and so on 25 times (cause the first date's control source is "txtFrom")
This formula does not take into consideration the date found on
"txtTo" to regulate when to stop.

If I put in the txtFrom the date of 01/01/05 and in the txtTo the date
of 05/01/05, I want for only those first 5 txt boxes in the report to
display the date range and leave the remaining 21 blank.

Any suggestions as to how to go about this, I ran out of think juice.
Thanks

So how about this:
=Iif(DateAdd("m",1,[txtDateA])<=[txtTo],DateAdd("m",1,[txtDateA]),NULL)
=Iif(DateAdd("m",1,[txtDateB])<=[txtTo],DateAdd("m",1,[txtDateB]),NULL)
....
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top