Connecting Tech Pros Worldwide Forums | Help | Site Map

Update All Rows on Continuous form Based on Selection in Footer

Patrick A
Guest
 
Posts: n/a
#1: Mar 26 '08
All,

I've got a continuous form with one field on it, with a comob

Patrick A
Guest
 
Posts: n/a
#2: Mar 26 '08

re: Update All Rows on Continuous form Based on Selection in Footer


Sorry about the auto-post. Don't know what keys I hit.

I have a continuous form with a combo box and a field on it, and a
combo box in the footer.
-----------
{body cbox} [field]
-----------
{body cbox} [field]
-----------
______
-----------
[footer cbox]
-----------

Let's say the combo box on the form is for the drinks I want...and I
can choose Martini, Gimlet, etc.

I can choose as many drinks as I want.

The combo box in the footer is my choice of liquor.

-----------
Gimlet [liquor]
-----------
Martini [liquor]
-----------
______
-----------
Gin
-----------

I only get to choose one type of liquor for any and all drinks. (Sad
example, but there you go. This is driving me to drink.)

Right now, the way my form behaves is when I change my type of liquor
in the footer, it only changes the type of liquor for the row I am
"on" in the body of the form. (I'm using an after update event in the
combo box in the footer:
Me.TB_Body = Me.CB_Footer.)

How can I get it to change the type of liquor for ALL rows in the body
of the form?

Thanks,

Patrick
Guillermo_Lopez
Guest
 
Posts: n/a
#3: Mar 27 '08

re: Update All Rows on Continuous form Based on Selection in Footer


On Mar 26, 5:35*pm, Patrick A <park...@stradley.comwrote:
Quote:
Sorry about the auto-post. *Don't know what keys I hit.
>
I have a continuous form with a combo box and a field on it, and a
combo box in the footer.
-----------
{body cbox} * [field]
-----------
{body cbox} * [field]
-----------
______
-----------
[footer cbox]
-----------
>
Let's say the combo box on the form is for the drinks I want...and I
can choose Martini, Gimlet, etc.
>
I can choose as many drinks as I want.
>
The combo box in the footer is my choice of liquor.
>
-----------
Gimlet * [liquor]
-----------
Martini * [liquor]
-----------
______
-----------
Gin
-----------
>
I only get to choose one type of liquor for any and all drinks. *(Sad
example, but there you go. *This is driving me to drink.)
>
Right now, the way my form behaves is when I change my type of liquor
in the footer, it only changes the type of liquor for the row I am
"on" in the body of the form. *(I'm using an after update event in the
combo box in the footer:
Me.TB_Body = Me.CB_Footer.)
>
How can I get it to change the type of liquor for ALL rows in the body
of the form?
>
Thanks,
>
Patrick
Patrick

Just be careful not to drive after drinking.

You can use a loop to go through all the rows in the form. I haven't
done this so i don't know the exact commands (those inside #) for most
of this so here is my best.

for i = 1 to #recordcount#
Me.TB_Body = Me.CB_Footer.
DoCmd.GoToRecord acDataForm, "FormName", acGoTo, i
next i

I can't find how to get the number of record in the Form. Best why i
can think of is to have a text control that counts the total number of
fields Count(*). And using that. Perhaps somebody else has a better
solution. Most of the stuff i've found in the net, have a ton of
coding.

- GL
Patrick A
Guest
 
Posts: n/a
#4: Mar 27 '08

re: Update All Rows on Continuous form Based on Selection in Footer


Guillermo,

Thanks for that

Hmmmm.

Any idea how I can get the name of the current subform, given that I
have 6 instances of it on my form, and the user could be in any of
them?

(When I use the Object Name of the form, Access tells me it's not
open.)


Thanks,

Patrick
Stuart McCall
Guest
 
Posts: n/a
#5: Mar 28 '08

re: Update All Rows on Continuous form Based on Selection in Footer


"Patrick A" <parkins@stradley.comwrote in message
news:2e84f461-56a4-4145-a674-42b27b155acb@a1g2000hsb.googlegroups.com...
Quote:
Guillermo,
>
Thanks for that
>
Hmmmm.
>
Any idea how I can get the name of the current subform, given that I
have 6 instances of it on my form, and the user could be in any of
them?
>
(When I use the Object Name of the form, Access tells me it's not
open.)
>
>
Thanks,
>
Patrick
Try:

Me.Parent.Name

That should give you the name of the subform control that is hosting your
form.


Patrick A
Guest
 
Posts: n/a
#6: Mar 28 '08

re: Update All Rows on Continuous form Based on Selection in Footer


Stuart,

Thanks for your response.

me.Parent.name gives me the Object name (FRM_My_SubForm) of the parent
form.
me.name gives me the Object name of the parent form (FRM_My_Form) .

I need the "Instance" name of the form, e.g. Forms!FRM_Inst1!
SFRM_Inst1, or Forms!FRM_Inst1!SFRM_Inst2, etc.

Any suggestions?
Stuart McCall
Guest
 
Posts: n/a
#7: Mar 29 '08

re: Update All Rows on Continuous form Based on Selection in Footer


"Patrick A" <parkins@stradley.comwrote in message
news:baf99838-ac0b-49dc-ab39-275483c57374@c65g2000hsa.googlegroups.com...
Quote:
Stuart,
>
Thanks for your response.
>
me.Parent.name gives me the Object name (FRM_My_SubForm) of the parent
form.
That sure sounds like the name of a subform control on the parent form
(which is the 'instance' name you mention). It certainly doesn't sound like
the name of the parent form. I think you need to take another look.
Quote:
me.name gives me the Object name of the parent form (FRM_My_Form) .
No, if the code is running on the subform, it gives you the name of _that_
form.
Quote:
>
I need the "Instance" name of the form, e.g. Forms!FRM_Inst1!
SFRM_Inst1, or Forms!FRM_Inst1!SFRM_Inst2, etc.
>
Any suggestions?

Patrick A
Guest
 
Posts: n/a
#8: Mar 31 '08

re: Update All Rows on Continuous form Based on Selection in Footer


Sorry, I miss-typed. Still trying to figure this out.

Invoked in the AfterUpdate event of the control on the sub form,
Quote:
me.parent.name gives me the Object name (FRM_My_Form) of the Parent form.
Quote:
me.name gives me the Object name of the Child form (SFRM_My_SubForm) .
I need the "Instance" name of the form,
e.g. Forms!FRM_My_Form_Inst1!SFRM_My_SubForm_Inst1, or Forms!
FRM_My_Form_Inst1!SFRM_My_SubForm_Inst2, etc.

Thanks,

Patrick
Stuart McCall
Guest
 
Posts: n/a
#9: Mar 31 '08

re: Update All Rows on Continuous form Based on Selection in Footer


"Patrick A" <parkins@stradley.comwrote in message
news:7a91c716-8abb-488d-b2fa-e9e7c9c11df6@8g2000hsu.googlegroups.com...
Quote:
Sorry, I miss-typed. Still trying to figure this out.
>
Invoked in the AfterUpdate event of the control on the sub form,
>
Quote:
>me.parent.name gives me the Object name (FRM_My_Form) of the Parent form.
>
Quote:
>me.name gives me the Object name of the Child form (SFRM_My_SubForm) .
>
I need the "Instance" name of the form,
e.g. Forms!FRM_My_Form_Inst1!SFRM_My_SubForm_Inst1, or Forms!
FRM_My_Form_Inst1!SFRM_My_SubForm_Inst2, etc.
>
Thanks,
>
Patrick
Ok, I've looked back through the thread and I'm not certain I have your
model correct in my mind. Let's review: As I understand it you have one main
form containing 6 subform controls, all of which contain the same form,
showing different data, presumably (else why do it).

Is that a correct summation?


Patrick A
Guest
 
Posts: n/a
#10: Apr 1 '08

re: Update All Rows on Continuous form Based on Selection in Footer


On Mar 31, 3:02*pm, "Stuart McCall" <smcc...@myunrealbox.comwrote:

Stuart,
Quote:
Ok, I've looked back through the thread and I'm not certain I have your
model correct in my mind. Let's review: As I understand it you have one main
form containing 6 subform controls, all of which contain the same form,
showing different data, presumably (else why do it).
>
Is that a correct summation?
Yes, that is correct.

While the Object name of the subform might be SFRM_Mine, the name I've
given it when I added it to the main form is what I'm after, e.g.
SFRM_Mine_Inst1, SFRM_Mine_Inst2, SFRM_Mine_Inst3, etc.

Thanks,

Patrick
Closed Thread


Similar Microsoft Access / VBA bytes