473,513 Members | 2,505 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Recalculate form

Hello,

I am using this sub to show a form as a control (thanks George) on a main
form. From a treeview the user can select which form should be shown and
worked on.

Private Sub ShowSubForm(ByVal sTabKey As String)

Dim ctl As Control

For Each ctl In Me.Controls
If TypeOf ctl Is Form Then
If ctl.Tag.ToString = sTabKey.ToString Then
ctl.BringToFront()
ctl.Show()
End If
End If
Next
End Sub

If a user later decides he wants to change a value in the first form, the
rest of the following forms need to be recalculated. Right now, I have to
show the form and loose focus on one of the textboxes to do this. I'd like
to have it done as soon as the form is brought to front again. But I can't
find any event that would trigger this.

Can someone help?

Thanks,

Jerry
Nov 21 '05 #1
2 1061
DWS
Jerry
I did something similar once. I made a public method called DWS on each
form that would refresh the form controls and then just called the dws
function in a loop from the main thread. Nothing tricky but it got the job
done.

dim x as form
For Each x In Me.Controls
try
x.DWS
catch
endtry
next

Good Luck
DWS
"Jerry" wrote:
Hello,

I am using this sub to show a form as a control (thanks George) on a main
form. From a treeview the user can select which form should be shown and
worked on.

Private Sub ShowSubForm(ByVal sTabKey As String)

Dim ctl As Control

For Each ctl In Me.Controls
If TypeOf ctl Is Form Then
If ctl.Tag.ToString = sTabKey.ToString Then
ctl.BringToFront()
ctl.Show()
End If
End If
Next
End Sub

If a user later decides he wants to change a value in the first form, the
rest of the following forms need to be recalculated. Right now, I have to
show the form and loose focus on one of the textboxes to do this. I'd like
to have it done as soon as the form is brought to front again. But I can't
find any event that would trigger this.

Can someone help?

Thanks,

Jerry

Nov 21 '05 #2
You might also be able to use the form event "VisibleChanged", which
fires when your form comes up again.

Shane

Nov 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
5635
by: John | last post by:
Dear all, It been more than 3 days I am trying to debug this program, I interpret it using activePerl and it is giving (perl -wc code_process.pl) no error syntax but when I put it online, change...
5
6072
by: Richard Cornford | last post by:
I am interested in hearing opinions on the semantic meaning of FORM (elements) in HTML. I have to start of apologising because this question arose in a context that is not applicable to the...
4
2097
by: Targa | last post by:
Trying to total some price fields in a form but doesnt work when all the referenced form fields dont exisit. This is for an invoice - pulled prom a database and the form doesnt always contain the...
25
10170
by: Lyn | last post by:
Hi, I am working on a genealogy form. The only table (so far) lists everybody in the family, one record per person. Each record has an autonum ID. The parent form (frmMainForm) displays the...
2
3560
by: Linda | last post by:
Hi, (Access 97) On my Menu form I have a button (cmdRefreshLinks) that refreshes/changes the linked tables in my database, and a calculated control (txtDataSource) that uses a custom function...
19
3585
by: Raposa Velha | last post by:
Hello to all! Does any of you want to comment the approach I implement for instantiating a form? A description and an example follow. Cheers, RV jmclopesAThotmail.com replace the AT with the...
11
18805
by: Jozef | last post by:
I have some old code that I use from the Access 95 Developers handbook. The code works very well, with the exception that it doesn't seem to recognize wide screens, and sizes tab controls so that...
5
73179
by: RAJ | last post by:
hi plz tell me how to know "how window is going to close"... i have to right code for X button of forms... plz telll me thanks bye
4
5258
by: araman | last post by:
I have a subform footer the gives a total of the total price controls in a continuous form. The main form runs a query that changes what is displayed in the subform. The sum in the footer doesnt...
0
7260
marktang
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,...
0
7161
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...
0
7384
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
7101
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
1
5089
isladogs
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...
0
4746
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...
0
3234
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...
0
1596
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 ...
1
802
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.