Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / General 1 / January 2006

Tip: Looking for answers? Try searching our database.

variables and control boxes

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
kaosyeti@comcast.net - 23 Jan 2006 23:14 GMT
hey... i have a 12 or so page report where each page is quite different from
the others.  the 20-50 controls i have on each page, however, are similar in
that they run on monthly and quarterly date intervals.  what i'd like to do
is to be able to declare a text box or something somewhere to be equal to a
date range and then reference this text box in other controls.  something
like this:

txtboxJANstart = dateserial(forms!formquarterly!txtboxyear, 1, 1)
txtboxJANend = dateserial (forms!formquarterly!txtboxyear, 1, 31)

except that while the control txtboxJANstart (formatted as \#mm/dd/yyyy\#)
DOES show #01/01/2005#, i can't use txtboxJANstart in any of the other
controls in the form.  all i get is #Error.  where can i convienently declare
these variables and call for them in controls in a report?  btw, i have
formquarterly opened the whole time this report runs, so that's not the issue.
thanks.
MGFoster - 24 Jan 2006 00:24 GMT
You shouldn't have the # marks showing in the Text Box, only the date.
The TextBox's Format should be "mm/dd/yyyy" (without the quotes, and
without the hash marks #).

Just set the ControlSource of txtboxJanStart to this:

  =DateSerial(Forms!FormQuarterly!txtBoxYear, 1, 1)

BTW the Hungarian prefix for a TextBox is just txt.  Your control would
be named

  txtJanStart

Signature

MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

> hey... i have a 12 or so page report where each page is quite different from
> the others.  the 20-50 controls i have on each page, however, are similar in
[quoted text clipped - 12 lines]
> formquarterly opened the whole time this report runs, so that's not the issue.
> thanks.
kaosyeti@comcast.net - 24 Jan 2006 01:12 GMT
the problem still lies in the fact that i can't seem to call on
txtboxJANstart at all from another control in the same report.  what am i
still missing there?

>You shouldn't have the # marks showing in the Text Box, only the date.
>The TextBox's Format should be "mm/dd/yyyy" (without the quotes, and
[quoted text clipped - 14 lines]
>> formquarterly opened the whole time this report runs, so that's not the issue.
>> thanks.
MGFoster - 24 Jan 2006 01:38 GMT
The other control's ControlSource would look like this:

  =txtboxJanStart

Is that how you've got it?
Signature

MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

> the problem still lies in the fact that i can't seem to call on
> txtboxJANstart at all from another control in the same report.  what am i
[quoted text clipped - 20 lines]
>>>formquarterly opened the whole time this report runs, so that's not the issue.
>>>thanks.
kaosyeti@comcast.net - 24 Jan 2006 01:49 GMT
actually, what i have is

=Abs(Sum([datesold] Between [txtboxJANstart] And [txtboxJANend]))

which does work when i type

=Abs(Sum([datesold] Between #1/1/2005# And #1/31/2005#))

the year is going to change as time goes by which is why i wanted it to be
this way.  otherwise i'm going to have to do a complicated series of controls
to calculate all of this.

>The other control's ControlSource would look like this:
>
[quoted text clipped - 6 lines]
>>>>formquarterly opened the whole time this report runs, so that's not the issue.
>>>>thanks.
MGFoster - 24 Jan 2006 02:24 GMT
Sometimes the TextBox isn't filled until "something" happens on the
report.  You may try forcing the matter in the Report_Open event.  Clear
the Control Source of the TextBoxes and in the Open event have something
like this:

  Me!txtboxJanStart = Forms!FormName!ControlName

Signature

MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

> actually, what i have is
>
[quoted text clipped - 21 lines]
>>>>>formquarterly opened the whole time this report runs, so that's not the issue.
>>>>>thanks.
kaosyeti@comcast.net - 24 Jan 2006 01:55 GMT
alternatively, why won't this work:

=abs(sum(datesold between # dateserial(txtboxyear, 1, 1) # and # dateserial
(txtboxyear, 1, 31) #))

or this

=abs(sum(datesold between # & dateserial(txtboxyear, 1, 1) & # and # &
dateserial(txtboxyear, 1, 31) & #))

it keeps telling me that i have an invalid date value

>The other control's ControlSource would look like this:
>
[quoted text clipped - 6 lines]
>>>>formquarterly opened the whole time this report runs, so that's not the issue.
>>>>thanks.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.