Connecting Tech Pros Worldwide Forums | Help | Site Map

variables and control boxes

kaosyeti@comcast.net via AccessMonster.com
Guest
 
Posts: n/a
#1: Jan 23 '06
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.

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...ccess/200601/1

MGFoster
Guest
 
Posts: n/a
#2: Jan 24 '06

re: variables and control boxes


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

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

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

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBQ9VzoYechKqOuFEgEQJJnACgz1TAJ909aiSAn+JMGTlwC2 6Kl68AnRgJ
O5DM37BWwXpfonUoJU2QhHlh
=4cTw
-----END PGP SIGNATURE-----


kaosyeti@comcast.net via AccessMonster.com wrote:[color=blue]
> 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.
>[/color]
kaosyeti@comcast.net via AccessMonster.com
Guest
 
Posts: n/a
#3: Jan 24 '06

re: variables and control boxes


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?



MGFoster wrote:[color=blue]
>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
>[color=green]
>> 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[/color]
>[quoted text clipped - 12 lines][color=green]
>> formquarterly opened the whole time this report runs, so that's not the issue.
>> thanks.[/color][/color]

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...ccess/200601/1
MGFoster
Guest
 
Posts: n/a
#4: Jan 24 '06

re: variables and control boxes


The other control's ControlSource would look like this:

=txtboxJanStart

Is that how you've got it?
--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

kaosyeti@comcast.net via AccessMonster.com wrote:[color=blue]
> 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?
>
>
>
> MGFoster wrote:
>[color=green]
>>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
>>
>>[color=darkred]
>>>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[/color]
>>
>>[quoted text clipped - 12 lines]
>>[color=darkred]
>>>formquarterly opened the whole time this report runs, so that's not the issue.
>>>thanks.[/color][/color]
>
>[/color]
kaosyeti@comcast.net via AccessMonster.com
Guest
 
Posts: n/a
#5: Jan 24 '06

re: variables and control boxes


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.

MGFoster wrote:[color=blue]
>The other control's ControlSource would look like this:
>
> =txtboxJanStart
>
>Is that how you've got it?[color=green]
>> 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[/color]
>[quoted text clipped - 20 lines][color=green][color=darkred]
>>>>formquarterly opened the whole time this report runs, so that's not the issue.
>>>>thanks.[/color][/color][/color]

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...ccess/200601/1
kaosyeti@comcast.net via AccessMonster.com
Guest
 
Posts: n/a
#6: Jan 24 '06

re: variables and control boxes


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



MGFoster wrote:[color=blue]
>The other control's ControlSource would look like this:
>
> =txtboxJanStart
>
>Is that how you've got it?[color=green]
>> 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[/color]
>[quoted text clipped - 20 lines][color=green][color=darkred]
>>>>formquarterly opened the whole time this report runs, so that's not the issue.
>>>>thanks.[/color][/color][/color]

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...ccess/200601/1
MGFoster
Guest
 
Posts: n/a
#7: Jan 24 '06

re: variables and control boxes


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

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

kaosyeti@comcast.net via AccessMonster.com wrote:[color=blue]
> 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.
>
> MGFoster wrote:
>[color=green]
>>The other control's ControlSource would look like this:
>>
>> =txtboxJanStart
>>
>>Is that how you've got it?
>>[color=darkred]
>>>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[/color]
>>
>>[quoted text clipped - 20 lines]
>>[color=darkred]
>>>>>formquarterly opened the whole time this report runs, so that's not the issue.
>>>>>thanks.[/color][/color]
>
>[/color]
Closed Thread