Reffering to controls of a continuous form 
Author Message
 Reffering to controls of a continuous form

Mota,

On a continuous form, the control/field reference (Me!
[TextBox1]) is always to the currently-selected record.  
When the form opens, this is the top/first record in the
list.  To reference a field in the second record/line, you
must select it manually, tab to it from the previous
record, or use code to move to it.

I'm guessing that the unbound control on your form is a
calculation on the three fields in each record.  If that's
the case, place the unbound control in the grid with the
other three fields (not in the header or footer section)
and set it's control source to the formula needed, e.g.:

  = ([TextBox1] + [TextBox2]) * [TextBox3]

The unbound field in each line in the grid will then
contain the properly-computed value for that record.

Bruce

Quote:
>-----Original Message-----
>Hi;
>I have a form having four text boxes,appearing

linear,named txt1,txt2,txt3
Quote:
>and txt4.The first 3 text box are bound to a table and
the last one is
>free.The default view of this form is "continuous

form".Now i want to put
Quote:
>data in txt4 (unbound control) based on its relative

first txt(for line 1 it
Quote:
>will be txt1), programmatically.Its easy for a normal

form,but when we set a
Quote:
>view to contiuous,we have made and named just 1 line of
this controls,and
>the next text boxes will appear automatically.Any

expression reffering txt1
Quote:
>or txt4,refers only to txt1 and txt4,not to other boxes
down them in their
>column.How to reffer to this controls in code?
>In other word,What will be the name of the controls that
wd appear in a form
>when we set forms default view to continuous forms?Can
anyone help me
>please?
>Any feedback is appreciated.Thank you.

>.



Tue, 03 May 2005 09:40:30 GMT  
 Reffering to controls of a continuous form
Hi;
I have a form having four text boxes,appearing linear,named txt1,txt2,txt3
and txt4.The first 3 text box are bound to a table and the last one is
free.The default view of this form is "continuous form".Now i want to put
data in txt4 (unbound control) based on its relative first txt(for line 1 it
will be txt1), programmatically.Its easy for a normal form,but when we set a
view to contiuous,we have made and named just 1 line of this controls,and
the next text boxes will appear automatically.Any expression reffering txt1
or txt4,refers only to txt1 and txt4,not to other boxes down them in their
column.How to reffer to this controls in code?
In other word,What will be the name of the controls that wd appear in a form
when we set forms default view to continuous forms?Can anyone help me
please?
Any feedback is appreciated.Thank you.


Tue, 03 May 2005 08:57:33 GMT  
 Reffering to controls of a continuous form
Thank you Bruce;
The unbound control is a calculated,but its value is not as simply as ur
code.
In fact,it uses DAO to look up two field in a table and if field1<field2
,its value will be
field2-field1 .I think using DAO is not as easy as ([TextBox1] + [TextBox2])
* [TextBox3].I need to reffer this unbound control to calculate its
conditional value in EACH line of the form.Do you have any suggestion to
assighn value to this unbound txtbox in ALL lines of the form?Or do I have
to change this form and make an unbound form with more than 400 line of
control ?!!! (How to do this???)
Thank you for your attention.


Quote:
> Mota,

> On a continuous form, the control/field reference (Me!
> [TextBox1]) is always to the currently-selected record.
> When the form opens, this is the top/first record in the
> list.  To reference a field in the second record/line, you
> must select it manually, tab to it from the previous
> record, or use code to move to it.

> I'm guessing that the unbound control on your form is a
> calculation on the three fields in each record.  If that's
> the case, place the unbound control in the grid with the
> other three fields (not in the header or footer section)
> and set it's control source to the formula needed, e.g.:

>   = ([TextBox1] + [TextBox2]) * [TextBox3]

> The unbound field in each line in the grid will then
> contain the properly-computed value for that record.

> Bruce

> >-----Original Message-----
> >Hi;
> >I have a form having four text boxes,appearing
> linear,named txt1,txt2,txt3
> >and txt4.The first 3 text box are bound to a table and
> the last one is
> >free.The default view of this form is "continuous
> form".Now i want to put
> >data in txt4 (unbound control) based on its relative
> first txt(for line 1 it
> >will be txt1), programmatically.Its easy for a normal
> form,but when we set a
> >view to contiuous,we have made and named just 1 line of
> this controls,and
> >the next text boxes will appear automatically.Any
> expression reffering txt1
> >or txt4,refers only to txt1 and txt4,not to other boxes
> down them in their
> >column.How to reffer to this controls in code?
> >In other word,What will be the name of the controls that
> wd appear in a form
> >when we set forms default view to continuous forms?Can
> anyone help me
> >please?
> >Any feedback is appreciated.Thank you.

> >.



Tue, 03 May 2005 22:10:19 GMT  
 Reffering to controls of a continuous form
Thank you;
I replied to Bruce and described my problem.I nedd a bit more help.Do you
have any better solution?
Waiting for reply,Thank you.


Quote:
> Hi Mota,

> What Bruce has described is a calculated control - and this might be what
> you need.

> A unbound control (controlsource is null) is only going to have one value
> and you would assign that value using code. On a continuous form that
value
> will appear on all rows. So you probably won't have much luck using an
> unbound control in a continuous form.

> --
> Sandra Daigle
> [Microsoft Access MVP]
> For the benefit of others please post all replies to this newsgroup.


> > Mota,

> > On a continuous form, the control/field reference (Me!
> > [TextBox1]) is always to the currently-selected record.
> > When the form opens, this is the top/first record in the
> > list.  To reference a field in the second record/line, you
> > must select it manually, tab to it from the previous
> > record, or use code to move to it.

> > I'm guessing that the unbound control on your form is a
> > calculation on the three fields in each record.  If that's
> > the case, place the unbound control in the grid with the
> > other three fields (not in the header or footer section)
> > and set it's control source to the formula needed, e.g.:

> >   = ([TextBox1] + [TextBox2]) * [TextBox3]

> > The unbound field in each line in the grid will then
> > contain the properly-computed value for that record.

> > Bruce

> >> -----Original Message-----
> >> Hi;
> >> I have a form having four text boxes,appearing linear,named
> >> txt1,txt2,txt3 and txt4.The first 3 text box are bound to a table and
> >> the last one is free.The default view of this form is "continuous
> >> form".Now i want to put data in txt4 (unbound control) based on its
> >> relative first txt(for line 1 it will be txt1), programmatically.Its
> >> easy for a normal form,but when we set a view to contiuous,we have made
> >> and named just 1 line of this controls,and the next text boxes will
> >> appear automatically.Any expression reffering txt1 or txt4,refers only
> >> to txt1 and txt4,not to other boxes down them in their column.How to
> >> reffer to this controls in code? In other word,What will be the name of
> >> the controls that wd appear in a form when we set forms default view to
> >> continuous forms?Can anyone help me please?
> >> Any feedback is appreciated.Thank you.

> >> .



Tue, 03 May 2005 22:12:57 GMT  
 Reffering to controls of a continuous form
Thank you;
I replied to Bruce and described my problem.I nedd a bit more help.Do you
have any better solution?
Waiting for reply,Thank you.


Quote:
> Hi Mota,

> What Bruce has described is a calculated control - and this might be what
> you need.

> A unbound control (controlsource is null) is only going to have one value
> and you would assign that value using code. On a continuous form that
value
> will appear on all rows. So you probably won't have much luck using an
> unbound control in a continuous form.

> --
> Sandra Daigle
> [Microsoft Access MVP]
> For the benefit of others please post all replies to this newsgroup.


> > Mota,

> > On a continuous form, the control/field reference (Me!
> > [TextBox1]) is always to the currently-selected record.
> > When the form opens, this is the top/first record in the
> > list.  To reference a field in the second record/line, you
> > must select it manually, tab to it from the previous
> > record, or use code to move to it.

> > I'm guessing that the unbound control on your form is a
> > calculation on the three fields in each record.  If that's
> > the case, place the unbound control in the grid with the
> > other three fields (not in the header or footer section)
> > and set it's control source to the formula needed, e.g.:

> >   = ([TextBox1] + [TextBox2]) * [TextBox3]

> > The unbound field in each line in the grid will then
> > contain the properly-computed value for that record.

> > Bruce

> >> -----Original Message-----
> >> Hi;
> >> I have a form having four text boxes,appearing linear,named
> >> txt1,txt2,txt3 and txt4.The first 3 text box are bound to a table and
> >> the last one is free.The default view of this form is "continuous
> >> form".Now i want to put data in txt4 (unbound control) based on its
> >> relative first txt(for line 1 it will be txt1), programmatically.Its
> >> easy for a normal form,but when we set a view to contiuous,we have made
> >> and named just 1 line of this controls,and the next text boxes will
> >> appear automatically.Any expression reffering txt1 or txt4,refers only
> >> to txt1 and txt4,not to other boxes down them in their column.How to
> >> reffer to this controls in code? In other word,What will be the name of
> >> the controls that wd appear in a form when we set forms default view to
> >> continuous forms?Can anyone help me please?
> >> Any feedback is appreciated.Thank you.

> >> .



Tue, 03 May 2005 22:12:57 GMT  
 Reffering to controls of a continuous form
Hi Mota,

What Bruce has described is a calculated control - and this might be what
you need.

A unbound control (controlsource is null) is only going to have one value
and you would assign that value using code. On a continuous form that value
will appear on all rows. So you probably won't have much luck using an
unbound control in a continuous form.

--
Sandra Daigle
[Microsoft Access MVP]
For the benefit of others please post all replies to this newsgroup.

Quote:

> Mota,

> On a continuous form, the control/field reference (Me!
> [TextBox1]) is always to the currently-selected record.
> When the form opens, this is the top/first record in the
> list.  To reference a field in the second record/line, you
> must select it manually, tab to it from the previous
> record, or use code to move to it.

> I'm guessing that the unbound control on your form is a
> calculation on the three fields in each record.  If that's
> the case, place the unbound control in the grid with the
> other three fields (not in the header or footer section)
> and set it's control source to the formula needed, e.g.:

>   = ([TextBox1] + [TextBox2]) * [TextBox3]

> The unbound field in each line in the grid will then
> contain the properly-computed value for that record.

> Bruce

>> -----Original Message-----
>> Hi;
>> I have a form having four text boxes,appearing linear,named
>> txt1,txt2,txt3 and txt4.The first 3 text box are bound to a table and
>> the last one is free.The default view of this form is "continuous
>> form".Now i want to put data in txt4 (unbound control) based on its
>> relative first txt(for line 1 it will be txt1), programmatically.Its
>> easy for a normal form,but when we set a view to contiuous,we have made
>> and named just 1 line of this controls,and the next text boxes will
>> appear automatically.Any expression reffering txt1 or txt4,refers only
>> to txt1 and txt4,not to other boxes down them in their column.How to
>> reffer to this controls in code? In other word,What will be the name of
>> the controls that wd appear in a form when we set forms default view to
>> continuous forms?Can anyone help me please?
>> Any feedback is appreciated.Thank you.

>> .



Tue, 03 May 2005 21:00:57 GMT  
 Reffering to controls of a continuous form
Mota,

Sorry to be so long getting back.  Tried to log onto the
group several times yesterday, but web kept telling me
that Microsoft's site was down.  (Couldn't even get to the
Microsoft.com home page!)

OK...

I'm by no means an "expert" like the MVPs and I may be
over-simplifying your problem, but you sure don't have to
make an unbound form with 400+ controls.  Try this:

Assuming that the two values you now look up using DAO are
somehow related to the data you want to display, use a
query for the continuous form's record source.  Include in
the query the datasource you now use for the text fields
of your current form *plus* the datasource(s) for the two
values you now look up using DAO.  Add a column for the
result of the calculation you want to perform based upon
the two "lookup" values.  (This will probably use an "IIf"
function.)  Return the 3 text values you now display *and*
the field with calculated value.  Display all 4 columns on
your continuous form.

In short, let the query perform the lookups and, if
possible, the greater-than less-than logic.  It will be
far faster than doing it on a record-by-record basis on
the form.

If you can't approach it this way, post the code you are
using to retrieve the DAO lookup values and to perform the
calculations.  (Shoot me an email so that I'll know it's
there.)  Maybe someone will have a better idea of how to
approach it.

HTH,
Bruce

Quote:
>-----Original Message-----
>Thank you Bruce;
>The unbound control is a calculated,but its value is not
as simply as ur
>code.
>In fact,it uses DAO to look up two field in a table and
if field1<field2
>,its value will be
>field2-field1 .I think using DAO is not as easy as

([TextBox1] + [TextBox2])
Quote:
>* [TextBox3].I need to reffer this unbound control to
calculate its
>conditional value in EACH line of the form.Do you have
any suggestion to
>assighn value to this unbound txtbox in ALL lines of the
form?Or do I have
>to change this form and make an unbound form with more
than 400 line of
>control ?!!! (How to do this???)
>Thank you for your attention.



>> Mota,

>> On a continuous form, the control/field reference (Me!
>> [TextBox1]) is always to the currently-selected record.
>> When the form opens, this is the top/first record in the
>> list.  To reference a field in the second record/line,
you
>> must select it manually, tab to it from the previous
>> record, or use code to move to it.

>> I'm guessing that the unbound control on your form is a
>> calculation on the three fields in each record.  If
that's
>> the case, place the unbound control in the grid with the
>> other three fields (not in the header or footer section)
>> and set it's control source to the formula needed, e.g.:

>>   = ([TextBox1] + [TextBox2]) * [TextBox3]

>> The unbound field in each line in the grid will then
>> contain the properly-computed value for that record.

>> Bruce

>> >-----Original Message-----
>> >Hi;
>> >I have a form having four text boxes,appearing
>> linear,named txt1,txt2,txt3
>> >and txt4.The first 3 text box are bound to a table and
>> the last one is
>> >free.The default view of this form is "continuous
>> form".Now i want to put
>> >data in txt4 (unbound control) based on its relative
>> first txt(for line 1 it
>> >will be txt1), programmatically.Its easy for a normal
>> form,but when we set a
>> >view to contiuous,we have made and named just 1 line of
>> this controls,and
>> >the next text boxes will appear automatically.Any
>> expression reffering txt1
>> >or txt4,refers only to txt1 and txt4,not to other boxes
>> down them in their
>> >column.How to reffer to this controls in code?
>> >In other word,What will be the name of the controls
that
>> wd appear in a form
>> >when we set forms default view to continuous forms?Can
>> anyone help me
>> >please?
>> >Any feedback is appreciated.Thank you.

>> >.

>.



Thu, 05 May 2005 12:23:55 GMT  
 Reffering to controls of a continuous form
Way down the bottom of these messages you mentioned you could move to the
next record in continuous forms programmatically.  Can you tell me how?


Quote:
> Mota,

> Sorry to be so long getting back.  Tried to log onto the
> group several times yesterday, but web kept telling me
> that Microsoft's site was down.  (Couldn't even get to the
> Microsoft.com home page!)

> OK...

> I'm by no means an "expert" like the MVPs and I may be
> over-simplifying your problem, but you sure don't have to
> make an unbound form with 400+ controls.  Try this:

> Assuming that the two values you now look up using DAO are
> somehow related to the data you want to display, use a
> query for the continuous form's record source.  Include in
> the query the datasource you now use for the text fields
> of your current form *plus* the datasource(s) for the two
> values you now look up using DAO.  Add a column for the
> result of the calculation you want to perform based upon
> the two "lookup" values.  (This will probably use an "IIf"
> function.)  Return the 3 text values you now display *and*
> the field with calculated value.  Display all 4 columns on
> your continuous form.

> In short, let the query perform the lookups and, if
> possible, the greater-than less-than logic.  It will be
> far faster than doing it on a record-by-record basis on
> the form.

> If you can't approach it this way, post the code you are
> using to retrieve the DAO lookup values and to perform the
> calculations.  (Shoot me an email so that I'll know it's
> there.)  Maybe someone will have a better idea of how to
> approach it.

> HTH,
> Bruce

> >-----Original Message-----
> >Thank you Bruce;
> >The unbound control is a calculated,but its value is not
> as simply as ur
> >code.
> >In fact,it uses DAO to look up two field in a table and
> if field1<field2
> >,its value will be
> >field2-field1 .I think using DAO is not as easy as
> ([TextBox1] + [TextBox2])
> >* [TextBox3].I need to reffer this unbound control to
> calculate its
> >conditional value in EACH line of the form.Do you have
> any suggestion to
> >assighn value to this unbound txtbox in ALL lines of the
> form?Or do I have
> >to change this form and make an unbound form with more
> than 400 line of
> >control ?!!! (How to do this???)
> >Thank you for your attention.



> >> Mota,

> >> On a continuous form, the control/field reference (Me!
> >> [TextBox1]) is always to the currently-selected record.
> >> When the form opens, this is the top/first record in the
> >> list.  To reference a field in the second record/line,
> you
> >> must select it manually, tab to it from the previous
> >> record, or use code to move to it.

> >> I'm guessing that the unbound control on your form is a
> >> calculation on the three fields in each record.  If
> that's
> >> the case, place the unbound control in the grid with the
> >> other three fields (not in the header or footer section)
> >> and set it's control source to the formula needed, e.g.:

> >>   = ([TextBox1] + [TextBox2]) * [TextBox3]

> >> The unbound field in each line in the grid will then
> >> contain the properly-computed value for that record.

> >> Bruce

> >> >-----Original Message-----
> >> >Hi;
> >> >I have a form having four text boxes,appearing
> >> linear,named txt1,txt2,txt3
> >> >and txt4.The first 3 text box are bound to a table and
> >> the last one is
> >> >free.The default view of this form is "continuous
> >> form".Now i want to put
> >> >data in txt4 (unbound control) based on its relative
> >> first txt(for line 1 it
> >> >will be txt1), programmatically.Its easy for a normal
> >> form,but when we set a
> >> >view to contiuous,we have made and named just 1 line of
> >> this controls,and
> >> >the next text boxes will appear automatically.Any
> >> expression reffering txt1
> >> >or txt4,refers only to txt1 and txt4,not to other boxes
> >> down them in their
> >> >column.How to reffer to this controls in code?
> >> >In other word,What will be the name of the controls
> that
> >> wd appear in a form
> >> >when we set forms default view to continuous forms?Can
> >> anyone help me
> >> >please?
> >> >Any feedback is appreciated.Thank you.

> >> >.

> >.



Tue, 17 May 2005 03:18:08 GMT  
 
 [ 8 post ] 

 Relevant Pages 

1. Continuous Form-Control Font Color Based on Control Value

2. Control Format, Continuous Form based on control value

3. Change color of a control with a value of another control using a Continuous Forms

4. Repost: Reffering to controls in a subform/subreport

5. Reffering to Control when Name is stored in Variable

6. Identifying Controls in the Detail of a Continuous Form Sub Form

7. Concatenate records or Continuous Form within a continuous form

8. Reffering to fields that belongs to the recordsource of a form

9. Image Control in Continuous Forms

10. Make Controls Invisible in a continuous form


 
Powered by phpBB® Forum Software © phpBB Group