Connecting Tech Pros Worldwide Help | Site Map

variables and control boxes

 
LinkBack Thread Tools Search this Thread
  #1  
Old January 23rd, 2006, 10:25 PM
kaosyeti@comcast.net via AccessMonster.com
Guest
 
Posts: n/a
Default variables and control boxes

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

  #2  
Old January 23rd, 2006, 11:35 PM
MGFoster
Guest
 
Posts: n/a
Default 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]
  #3  
Old January 24th, 2006, 12:25 AM
kaosyeti@comcast.net via AccessMonster.com
Guest
 
Posts: n/a
Default 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
  #4  
Old January 24th, 2006, 12:45 AM
MGFoster
Guest
 
Posts: n/a
Default 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]
  #5  
Old January 24th, 2006, 01:05 AM
kaosyeti@comcast.net via AccessMonster.com
Guest
 
Posts: n/a
Default 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
  #6  
Old January 24th, 2006, 01:05 AM
kaosyeti@comcast.net via AccessMonster.com
Guest
 
Posts: n/a
Default 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
  #7  
Old January 24th, 2006, 01:35 AM
MGFoster
Guest
 
Posts: n/a
Default 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]
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,662 network members.