Hi all,
A subForm control, txtTotalSubForm contains a total from one of the fields
on this subForm . The mainForm contains a combo, myCombo which filters, and
updates the details on the subForm. I want this update to pass the value in
txtTotalSubForm to a control txtMainForm, on the main form. Ive tried using
the parent property, but this is not adequate since I must click onto the
subform to trigger it (on current event of the subform).
The code i tried for the update of the myCombo is as follows
----------------------------------------
Private Sub myCombo_AfterUp date()
Me.Controls("My SubForm").Reque ry
Me.Refresh
Me.myMainFormTx tBox = Me.mySubform.Co ntrols("mySubfo rmTotalControl" )
End Sub
----------------------------------------
I know the last line works, since it works from a button, after i've
updated, but not from the combo box update.
Is there some kind of timing issue that im missing. Its like calling on this
before the data is updated?
Any help/Advice would be most welcome.
Gerry Abbott 4 1769
Gerry,
I would try to requery the txtTotalSubForm before your last line.
Arno R
"Gerry Abbott" <pl****@ask.i e> schreef in bericht news:Kj******** ***********@new s.indigo.ie... Hi all, A subForm control, txtTotalSubForm contains a total from one of the fields on this subForm . The mainForm contains a combo, myCombo which filters, and updates the details on the subForm. I want this update to pass the value in txtTotalSubForm to a control txtMainForm, on the main form. Ive tried using the parent property, but this is not adequate since I must click onto the subform to trigger it (on current event of the subform). The code i tried for the update of the myCombo is as follows ---------------------------------------- Private Sub myCombo_AfterUp date() Me.Controls("My SubForm").Reque ry Me.Refresh Me.myMainFormTx tBox = Me.mySubform.Co ntrols("mySubfo rmTotalControl" ) End Sub ---------------------------------------- I know the last line works, since it works from a button, after i've updated, but not from the combo box update. Is there some kind of timing issue that im missing. Its like calling on this before the data is updated? Any help/Advice would be most welcome. Gerry Abbott
Sorry, that does not work for me.
Thanks for the quick reply.
Added the line as advised (see code below). Still no change.
----------------------------------------
Private Sub myCombo_AfterUp date()
Me.Controls("My SubForm").Reque ry
Me.MySubform.co ntrols("txtTota lSubForm")
Me.Refresh
Me.myMainFormTx tBox = Me.mySubform.Co ntrols("mySubfo rmTotalControl" )
End Sub
----------------------------------------
if I remove the requery then it updates the txt box. But it wont run the
filter.
So once the requery and the assignment are in the same module, it wont work.
Could probably get round this with and sql statement, but thought there
would be an easy way.
Im sure that im missing something simple here.
Any more Advice ?
Gerry Abbott
> Private Sub myCombo_AfterUp date() Me.Controls("My SubForm").Reque ry Me.MySubform.co ntrols("txtTota lSubForm") Me.Refresh Me.myMainFormTx tBox = Me.mySubform.Co ntrols("mySubfo rmTotalControl" ) End Sub
Gerry,
I don't see the requery in your new code ... Typo?
Should be: Me.MySubform.co ntrols("txtTota lSubForm").Requ ery <<====
However it would not surprise me if it won't work also...
I also recall having these issues sometimes. (Refresh-Repaint-DoEvents, nothing works 'sometimes')
Could probably get round this with and sql statement, but thought there would be an easy way.
If you can't work it out I would go for the sql-option.
Maybe even in this case I would go for the sql-option right away.
If you rely on a calculated control you never know when Access is ready...
Arno R
Yes Arno, Typo in the mail only (unfortunately)
U know it would give me a big error if i left it out in the code.
Private Sub myCombo_AfterUp date()
Me.Controls("My SubForm").Reque ry
Me.MySubform.co ntrols("txtTota lSubForm").Requ ery
Me.Refresh
Me.myMainFormTx tBox = Me.mySubform.Co ntrols("mySubfo rmTotalControl" )
End Sub
Yeah, Ive run into this problem before.
For the moment, until i get a better solution, ive got a big 'calculate'
button on the form.
(Im not that happy with it, but there you go)
I'll get a better solution if i've time left at the end of the project...
(or unless some person much wiser than I, can supply me a magical
solution....... )
Gerry. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Ima Lostsoul |
last post by:
Access XP
Access 2002 format.
I have a subform on a tab control. The subform has the following
code (error trapping removed to make post shorter)... When I close the
parent form it goes 100% as designed UNLESS I have used one of the sort
buttons to sort the sub form on any given field. If I do sort, there is
a delay fo about 5 seconds until after the parent form closes and the
previous form re-opens. It appears that there may be...
|
by: Not Me |
last post by:
Hi,
Just trying to get my head around tab controls, is there anywhere which
would describe the structure of how they work? I seem to be ok so far,
being able to check which page I'm on etc... but I'm at a loss when
trying to access controls inside the tabs.
If I try to access the form directly (!...etc.) I get an error
that the form can't be found. I'm not sure how I can use parent/child
relationships to get at the (sub)forms which...
|
by: sparks |
last post by:
I am in a subform on a subform and need to get to a subform on a
subform...LOL
on 2 tabs.
so I have
FORM MAIN
|
by: Rick |
last post by:
I have a main form called frmDemo with a subform frmStageTrack_Sub. On
the subform is a Combo Box CboTermID. The frmDemo is tied to tblDemo
and the frmStageTrack_Sub is tied to tblStageTrack. What I would like
to do is when a new record is created in frmDemo I would like to set
the CboTermID on the subform to a default value, say 1, without the
user having to set focus on the subform and selecting an item from the
combo box. Right now...
|
by: vsteshenko |
last post by:
Hello,
This is my second post to the any usernet group and the first one was
posted to the wrong one.
I am currently working on creating an order form for sales associates
at my work to be used at conventions. I have a main form with two
subforms. On the main form, there is a text box that displays the sum
of total orders entered in the subform, . I'm trying to
create another text box on the main form, that looks at the
subtotal...
| |
by: BillCo |
last post by:
I'm a C# Newbie, so if I've missed the obvious here go easy!!!
I have a form opened from a MDI parent. The form has a data bound
combo box, with a SelectedIndexChanged event (fills a list view box on
the same form depending on selection). It all works fine except when
you close either the form itself or it's MDI parent. Somehow as the
form is closing this event is triggered, and crashes out with an un-
handled error (even though it's in...
|
by: nospam |
last post by:
--------------------------------------------------------------------------------
I have a subform with the related IDs for each customer on the
customer main form.
I have a button on the continuous subform, which will make the main
customer record go to that sub related record's customer record.
(follow me?)
Problem is that once I am at the related record, if I push the button
|
by: solom190 |
last post by:
Okay this is the situation I have two forms and they have a 1:M relationship. I don't have enough space screen-wise to do a traditional "drag form to form" to create a subform so what I did was create command buttons that open the subform when I click on it.
I added a filter to the VBA that filters the results of the subform to display only records that match the linking field of the two forms. And it those and would filter but..I am having...
|
by: skips84s |
last post by:
I have a parent form with four tabbed subforms. On subform x, selecting a value from a combo box should update a few controls on this subform, as well as a control on subform y, all done using dlookups. Each of the controls does have a valid control source in the same table. Right now, I can update the controls on subform x with no problem. When I add the code to update subform y, however, the control in subform y updates and saves the...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |