Welcome to Windows Help!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

Referring to form control

 
   Windows Help (Home) -> Microsoft Access RSS
Next:  Lost color red  
Author Message
John M

External


Since: Feb 3, 2010
Posts: 3



(Msg. 1) Posted: Wed Feb 03, 2010 10:43 am
Post subject: Referring to form control
Archived from groups: microsoft>public>access (more info?)

I have a dialog form, with 4 unbound text controls.
TestNo1 TestNo2 TestNo3 TestNo4
This form opens a 1 page report with (for ex.) one control.
(TestNo?X.?.. see below)

In the report query, I have a tblPrintMultiplier with [PrintMultiplier]
values from 1 to 4, in a Cartesian relationship with my other report
table/s.
This PrintMultiplier can cause from 1 to 4 report pages to print.

For example if PrintMultiplier = 4

How can I use that PrintMultiplier in my query, to refer to
the open Forms!frmFormName!TestNo values, so
page one displays TestNo1
page 2 displays TestNo2
etc.

I just can't seem to find the correct syntax.

Thanks
John

 >> Stay informed about: Referring to form control 
Back to top
Login to vote
Dorian

External


Since: Dec 4, 2008
Posts: 6



(Msg. 2) Posted: Wed Feb 03, 2010 12:51 pm
Post subject: RE: Referring to form control
Archived from groups: per prev. post (more info?)

Af far as I know, you cannot 'create' a variable name in a query.
However, you could do something like
IIF(PM=1,...,IIF(PM=2,...,IIF(PM=3...,...)))
-- Dorian
"Give someone a fish and they eat for a day; teach someone to fish and they
eat for a lifetime".


"John M" wrote:

> I have a dialog form, with 4 unbound text controls.
> TestNo1 TestNo2 TestNo3 TestNo4
> This form opens a 1 page report with (for ex.) one control.
> (TestNo?X.?.. see below)
>
> In the report query, I have a tblPrintMultiplier with [PrintMultiplier]
> values from 1 to 4, in a Cartesian relationship with my other report
> table/s.
> This PrintMultiplier can cause from 1 to 4 report pages to print.
>
> For example if PrintMultiplier = 4
>
> How can I use that PrintMultiplier in my query, to refer to
> the open Forms!frmFormName!TestNo values, so
> page one displays TestNo1
> page 2 displays TestNo2
> etc.
>
> I just can't seem to find the correct syntax.
>
> Thanks
> John
>
>
>
> .
>

 >> Stay informed about: Referring to form control 
Back to top
Login to vote
John M

External


Since: Feb 3, 2010
Posts: 3



(Msg. 3) Posted: Wed Feb 03, 2010 7:42 pm
Post subject: Re: Referring to form control
Archived from groups: per prev. post (more info?)

Dorian,
Well, I was hoping to use PM =1 and "TestNo" to identify TestNo1
on the open dialog form, and so on.
Actually, on the form itself I use Me("TestNo" & PCNo) to identify
the [TestNo1] control.
(I use PCNo on the form just like I'm trying to use PM on the report)
But perhaps, as you say, it's not possible for a query/SQL to use
such a reference.

I would think your method would work, as long as there will be just
be 4 possible values. Any more than that could get a bit "clunky"

Let me give that a try, and I'll get back.
Thanks-
John

"Dorian" wrote in message

> Af far as I know, you cannot 'create' a variable name in a query.
> However, you could do something like
> IIF(PM=1,...,IIF(PM=2,...,IIF(PM=3...,...)))
> -- Dorian
> "Give someone a fish and they eat for a day; teach someone to fish and
> they
> eat for a lifetime".
>
>
> "John M" wrote:
>
>> I have a dialog form, with 4 unbound text controls.
>> TestNo1 TestNo2 TestNo3 TestNo4
>> This form opens a 1 page report with (for ex.) one control.
>> (TestNo?X.?.. see below)
>>
>> In the report query, I have a tblPrintMultiplier with [PrintMultiplier]
>> values from 1 to 4, in a Cartesian relationship with my other report
>> table/s.
>> This PrintMultiplier can cause from 1 to 4 report pages to print.
>>
>> For example if PrintMultiplier = 4
>>
>> How can I use that PrintMultiplier in my query, to refer to
>> the open Forms!frmFormName!TestNo values, so
>> page one displays TestNo1
>> page 2 displays TestNo2
>> etc.
>>
>> I just can't seem to find the correct syntax.
>>
>> Thanks
>> John
>>
>>
>>
>> .
>>
 >> Stay informed about: Referring to form control 
Back to top
Login to vote
John M

External


Since: Feb 3, 2010
Posts: 3



(Msg. 4) Posted: Thu Feb 04, 2010 1:46 pm
Post subject: Re: Referring to form control
Archived from groups: per prev. post (more info?)

Dorian,
That did the trick.
I used it in a pass-thru query.
Thanks,
John

"Dorian" wrote in message

> Af far as I know, you cannot 'create' a variable name in a query.
> However, you could do something like
> IIF(PM=1,...,IIF(PM=2,...,IIF(PM=3...,...)))
> -- Dorian
> "Give someone a fish and they eat for a day; teach someone to fish and
> they
> eat for a lifetime".
>
>
> "John M" wrote:
>
>> I have a dialog form, with 4 unbound text controls.
>> TestNo1 TestNo2 TestNo3 TestNo4
>> This form opens a 1 page report with (for ex.) one control.
>> (TestNo?X.?.. see below)
>>
>> In the report query, I have a tblPrintMultiplier with [PrintMultiplier]
>> values from 1 to 4, in a Cartesian relationship with my other report
>> table/s.
>> This PrintMultiplier can cause from 1 to 4 report pages to print.
>>
>> For example if PrintMultiplier = 4
>>
>> How can I use that PrintMultiplier in my query, to refer to
>> the open Forms!frmFormName!TestNo values, so
>> page one displays TestNo1
>> page 2 displays TestNo2
>> etc.
>>
>> I just can't seem to find the correct syntax.
>>
>> Thanks
>> John
>>
>>
>>
>> .
>>
 >> Stay informed about: Referring to form control 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
There is no object in this control - My Access 2003 application was working for years. I then received "There is no object in this control" when I opened one of my forms. The form references a control in mscomctl.ocx. The control that it did not like was the TreeView control. ...

A Form that leads to a second Form - I have a button on my first form that opens up a second form which has a button on it leading to a third form. I would like the 3rd form to gather the client Name, Phone, ID from the first form. But when I do this I get the 1st record in the database....

Referencing a subform control on a subreport - Hello, I would like to copy a calculated control of an unbound control on to a report. On my form (F_SampleRequest) i have a button which opens the report. Here is the code for the button: Private Sub btnOpenSampleReport_Click() DoCmd.OpenReport..

you don't have the license required to use htis activex co.. - I am using Access 2007 and wanted to add the microsoft common dialog control to a form so I could have a print dialog box pop up when my print button is clicked. Couple of questions: 1)Can I get the print dialog to show up using vba in a different..

Ensuring uniform control width on forms and reports - This utility ensures you have uniform control width on forms and reports. This example shows the Unit Number as found in many forms and reports through out the Granite Fleet Manager. Other examples might be part numbers, serial numbers, license plat...
   Windows Help (Home) -> Microsoft Access All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]