473,809 Members | 2,620 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Detecting a Sub-Form event from the Main Form 2

16 New Member
I have developed a way to enter the data from long medical document, using structure: Mainform (subform1,... subfromN). This is reflecting the logical model of data: Document(sectio n1,section2,... sectionN).

The MainForm has only one control, subfrom, in Detail which displays consecutively section1,...sec tionN. This is done by buttons "Next" and "Previous" located in MainForm's Footer.

I was quite happy with this design: subforms, which could be of hundreds' did not have class modules, thus saving memory and making design simpler.

Until data entering person claims, that it would be more comfortable if after one section is filled, the other is coming automatically, without pressing "Next".

So far I couldn't find a solution for this challenge, i.e. keeping subforms without class modules and fishing up "end of filling the subform" from the MainForm.

Any hints.
Aug 12 '09 #1
13 3791
ChipR
1,287 Recognized Expert Top Contributor
What's the code in your "Next" button? Just to get an idea of what you're doing exactly.
Aug 12 '09 #2
FelixS
16 New Member
It is very simple there, in class module

Private Sub NextForm_Click( )
Call NextPriv(Me.Nam e, 1)
End Sub


NextPriv is determining which section is to include in subform.
For example, there is main form F02 and section forms F02001 - F02005
Next for F02005 is saving records and close F02. For all other the next Form is
determined as nextFrm and changes settings by statement

Forms(pubLFrmNa me).FormSec.Sou rceObject = nextFrm

This causes main form change the subform contents.
Aug 12 '09 #3
ChipR
1,287 Recognized Expert Top Contributor
In that case, why not have your subform after the last field is updated
Call NextPriv(Me.Par ent.Name, 1) <- Though I'm not sure what the 1 is for
Aug 12 '09 #4
FelixS
16 New Member
1. 1 means 1 next, 2 means previous.
2. The main question is how to do this without class module for subform. In other words, how to fish up the situation of focus on last control in the subform, from the main form. Once more, it is very straightforward to handle this event being in subform and using class module for this subform. However, the solution, being searched is how to do this without class modules for subforms.
Aug 12 '09 #5
ChipR
1,287 Recognized Expert Top Contributor
I don't see any way to get the focus out of the subform without calling a macro or some code.
Aug 12 '09 #6
FishVal
2,653 Recognized Expert Specialist
To the best of my knowledge there is no way to catch subform's components events unless form which is a SourceObject of subform control has module. It could be empty, but it has to exist.
IMHO, maximum you can do without the modules is continuous polling of subform's controls.

Regards,
Fish.
Aug 13 '09 #7
FelixS
16 New Member
I have found how to do this.
Aug 17 '09 #8
ChipR
1,287 Recognized Expert Top Contributor
Would you mind sharing?
Aug 17 '09 #9
FelixS
16 New Member
at the moment I have only tested part of code and general Idea.
It could be done using
Private Sub Form_Timer()
<procedure to run every ### milliseconds>
End Sub

Sub Form_Load()
Me.TimerInterva l = 1000
End Sub

and ActiveControl Property

Dim ctlCurrentContr ol As Control
Dim strControlName As String
Set ctlCurrentContr ol = Screen.ActiveCo ntrol
strControlName = ctlCurrentContr ol.Name
*************** ***************
In fact now I am trying to solve the last outstanding problem in my task:
to set focus on the first text box in subform after the form is loaded. The name of text box is stored in variable.
So far no any working solution
Aug 17 '09 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

6
8596
by: dreamer | last post by:
I need to be able to detect different screen resolutions and then resize my applications forms, objects, fonts etc, to suit. Any ideas how to go about it? I use VB 5. Many thanks in advance.
5
8876
by: Lars Moastuen | last post by:
Hi! I'm currently playing around with a project where I need to know if an object (any object) has been altered since last check. I need this to know when an object needs to be saved... My idea was to represent the object as a byte-array and then make a MD5-hash out of that byte (not very efficient though - but that won't really be a big problem here)... I guess that works fine as long as the object I need to check for updates doesn't...
9
2750
by: Bijoy Naick | last post by:
I've implemented forms authentication and authorization on my application. In my Web.Config, my authorization section looks like this.. <authorization> <allow roles="admin" /> <deny users="*" /> </authorization> If an authenticated user, who is NOT designated the role "admin" attempts to access this folder, he/she is simply redirected to the login page.
4
1437
by: Joe | last post by:
Hi, I have a asp.net page that checks if any one of the two cookies exists. If none of the cookies exist then redirect the user to login page. Cookie “try” doesn’t exists. I can see that cookie “mode” exist, but for some reason the following code fails to detect it and keeps redirecting user to login.aspx page which it shouldn’t because the cookie “mode” exists Can someone tell me what could be the problem?
6
1937
by: Nathan | last post by:
How can I detect when one of the arrow keys is pressed? Thanks, Nathan
2
1423
by: David Batt | last post by:
Hi, I need to determine when data in a datagrid bound to a dataset has changed and thus make updates accordingly. I would of thought the code below would detect when a change has been made to the dataset, however the haschanges value is set to true even if i just click on a cell without changing anything. is there anyway of telling if anything has actually really changed on the bound grid. I need to know when an actual changes are made,...
6
6999
by: jcrouse | last post by:
I have the following mouse events assigned to a label control. Is the a way I can tell which mouse button the users has clicked with? Private Sub lblP1JoyUp_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles lblP1JoyUp.Click If bMouseMove = False Then If bCtrlKey = True Then
7
7758
by: Wayne Wengert | last post by:
I am using VB with a Windows NET application. I have a datagrid in which the user can add rows using the "*" row. I want to detect whenever the user has added a row. I found the following code at syncfusion.com but it is in C# and I am having a problem converting it to VB. If anyone can show the VB equivalent and/or point me to a better way to detect a row change I'd appreciate it. Wayne
2
1222
by: James | last post by:
Hi. I'm probably attempting the impossible but what the hey. I'm modifying a multi-paneled form which has 8 different listviews, To allow sorting by columns I've had to add a diffrerent handler Sub for each of them eg. Private Sub ListViewOne(ByVal o As Object, ByVal e As ColumnClickEventArgs) ... End sub
1
1647
by: batista | last post by:
Hello to all, I'm using the HScrollBar Control in one of my apps. Now the problem is how to detect that when did the scrollbar reached its right end or left end.? Please Any Suggestions....
0
9603
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,...
1
10387
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10120
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9200
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development projectplanning, coding, testing, and deploymentwithout human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7662
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 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...
0
5550
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...
1
4332
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
2
3861
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3015
bsmnconsultancy
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...

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.