How To Change Properties Of The Parent Form From A Modal Child Form, Plz?
I want to open a child form windows (frmPortSetting) and from there changing some ActiveX components properties (comTx) which are on my parent form (frmMain). I wrote code in frmPortSetting sub procedure but it seems that I can't change comTx properties directly there. (e.g. comTx.settings(9600,n,8,1)) Any advise please?
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
How To Change Properties Of The Parent Form From A Modal Child Form, Plz?
I want to open a child form windows (frmPortSetting) and from there changing some ActiveX components properties (comTx) which are on my parent form (frmMain).
I wrote code in frmPortSetting sub procedure but it seems that I can't change comTx properties directly there. (e.g. comTx.settings(9600,n,8,1)) Any advise please?
Change Form From Child To Parent
Hello All:
I have a strange one. I am creating a program for my company in VB6 this time and I have a couple child forms in my project. Well two workstations that this program is going to be run on have 2 monitors. So it has been requested that I take one or two of my child forms and make them standard forms that can be drug to another screen.
So my question is can I programmably change a child form to a regular form so that I don't have to maintain code in two seperate forms and put in a preference for what form to turn on?
The_King
Old Problem, Still No Solution? (modal Form Losing Focus When Parent Form Is Minimize
Hi everyone,
I have a problem with modal forms that's very easy to reproduce, and
practically locks up the application:
When closing Form1 I display a modal from (Form2), more or less to
request
the user if he's sure, etc. That works fine if Form1 is in normal
window
state and visible.
If I minimize Form1 in the windows Taskbar before closing it using the
system menu, Form2 appears, but is grayed and cannot receive mouse or
keyboard input. Because Form2 is displayed and modal, I cannot do
anything
else with the application. As far as the user is concerned, it's dead
and
frozen.
Form2 does not receive a Deactivate or LostFocus event, where I could
possible "repair" things.
Cheers, Marek
Get The Parent/Owner Form Of A Modal Form
Does any one know how to get the Parent or OwnerForm of a Modal Form?
I am using the Forms collection to unload all forms in application exit.
vb Code:
For Each frm In Forms If frm.name <> CurrentForm.name Then Unload frm Set frm = Nothing End If Next frm
But this hangs when the current form is a modal Form (the Login Form) showed uppon another form. The reason (as I guess) is that above code is trying to unload the Parent of the current form which wont unload until this current form is unloaded. If that is so,it'd create a dead lock situation.
And I call this code in QueryUnload. So is there any method to get the name of the modal Form's parent ?
Thanks In Advance
Returning A Value Found In A Child Form To A Specific Text Box In The Parent Form?
I have two forms. A parent and a child. The parent has many labels which are selectable. Once one of the many lables is selected, a child form pops up to gather info. Once the info is gathered, i want to be able to put that info into the label in the parent form which called the child! How can this be done? The problem i cant get past is when the child returns, i have no way to know which label called the child in the first place to put the info in.
Thanks in advance
Open A Child Form At The Same Record As Its Parent Form
I am trying to open a child form from a parent form, say the parent form is on record number 20. 20 is the ID number for the record. I want the child form to then also move to record number 20.
These forms are of the same table data, I just want some of the data displayed on the child form top avoid congestion.
I've looked at DoCmd.GotoRecord and DAO options. I think an ADO option is too complicated for just form data.
Thanks in advance for any help you can provide.
***RESOLVED***MDI Child Form Placement In Parent Form
I am using the MDI Parent/Child forms in my project.
I have one of my child forms open. On this child form is a command button which opens a second child form. I would like it if when the second child form is opened, it opens directly below the first child form. It would also be great if it would open below the first child form regardless of where the user has moved this form on their screen.
thank you
Displaying A Child Form Without Parent Form In Backround??
I want to create a form that behaves just like Outlook mail notification. I have an application that I want to display a notify form that something has happened. I want this notify form to display centered and topmost. Once the notify form is front and center I want the ability to act on it or select another application to have notify form disappear or minimized showing it on the taskbar. Then when I select the notify form from the taskbar, it will show but NOT have my parent application show.
I can set the form on the top and have it centered. I just need help with the rest.
Thanks,
ERS
Modal, But JUST For The Parent Form
I'm making a custom message box. I want to show it as a modal, but only for its parent. Right now I'm using the show command I.E.
Code:
Show vbModal, ParentForm
I want ONLY the parent form to lock up, because I want to be able to have the message box open and still be able to load a form in another window.
Any ideas on how to do this?
Child Form Always On Top Of Parent When Parent Not Minimised
I've been getting some great help from this forum thus far, my thanks to you
all who have helped thus far.
My problem now lies in that I wish to make a child form spawned from the
parent always remain on top of the parent, but only when the parent is
visible. ie. I haven't minimised the application.
I managed to incorporate some code obtained from the VBToolbox by
Vijayakumar Kannan which allows me to keep a form on top, but the problem
lies in that the form always remains on top (of every app) even when the
parent is minimised.
Thanks in advance.
******Code used is as follows*******
' DECLARED AT MODULE LEVEL
Option Explicit
Public Const SWP_NOMOVE = 2
Public Const SWP_NOSIZE = 1
Public Const FLAGS = SWP_NOMOVE Or SWP_NOSIZE
Public Const HWND_TOPMOST = -1
Public Const HWND_NOTOPMOST = -2
Declare Function SetWindowPos Lib "user32" _
(ByVal hwnd As Long, _
ByVal hWndInsertAfter As Long, _
ByVal x As Long, _
ByVal y As Long, _
ByVal cx As Long, _
ByVal cy As Long, _
ByVal wFlags As Long) As Long
Public Function SetTopMostWindow(hwnd As Long, Topmost As Boolean) _
As Long
If Topmost = True Then 'Make the window topmost
SetTopMostWindow = SetWindowPos(hwnd, HWND_TOPMOST, 0, 0, 0, _
0, FLAGS)
Else
SetTopMostWindow = SetWindowPos(hwnd, HWND_NOTOPMOST, 0, 0, _
0, 0, FLAGS)
SetTopMostWindow = False
End If
End Function
' DECLARED IN THE FORM
Private Sub Form_Load()
Dim lR As Long
lR = SetTopMostWindow(Me.hwnd, True) ' always on top
End Sub
Parent Form Calling Child Form
How does a main form call a sub-form to show onscreen and begin doing what it's supposed to be doing? Do I just use
frmSecond.Show ? Or do I have to Call the form?
Accesing The MDI Parent Form From A Child Form
Hello, It's the firs time I work with MDI and I don't know how to acces controls or properties for the MDI parent form form within the code of a child form.
2 examples.
I have a MDI parent form called frmMain, on this form I have a Status Bar control called StatBar, form the code of a child form I want to modify the text on one panel of the status bar like this:
Code:
frmMain.StatBar.Panels(3).Text=Str(XX)
but this don't work,
also I want to read the property for the Parent form like:
Code:
if me.width > frmMain.Width then
me.Width=frmMain.Width - 100
end if
and this doesn't work either,
How can i do this?
MDI Parent Form, Using Menus From Child Form
I have managed to do this before, but can't remember what properties I need to set so that when I select a child form the MDI forms menu has the child forms menu on the right of it's own menu... Does that make sense?
At the moment, when I select a child form, the MDI forms menu is replaced with the child forms...
It's going to be one of those days!
Docking A Child Form To Parent Form?
I want my active child form to dock immediately under my parent forms toolbar, not centered in screen. No matter what settings I choose, the child form does not seem to do this, and so part of the child form is not visible(below screen). does anyone know how to do this?
Is There A Form, That Can Be Put In The Middle Of MDI.Parent And MDI.Child Form?
Hello!Everybody!
In my MDI form programing,I want to a form,that always on the top of the MDI.Parent form,and that always on the back of the MDI.Child forms.What should I do?
When I put a control,for example a TextBox in the MDI.Parent's from,and I set the dock
"fill".When I open a MDI.Child form,it can't to be seen.When I set MDI.Child form "topmost",the problem is alse!!!
I think I do need some Help!Thank U!
From China
Edited by - dehuiworkroom@hotmail.com on 12/17/2003 9:28:54 PM
Center MDI Child Form In MDI Parent Form
I wrote the below code to center the MDI child form in MDI Parent form.
Code:
Private Sub Form_Load()
CenterChild frmMain, frmLogin
End Sub
Sub CenterChild(Parent As Form, Child As Form)
Dim iTop As Integer
Dim iLeft As Integer
If Parent.WindowState <> 0 Then Exit Sub
iTop = ((Parent.Height - Child.Height) 2)
iLeft = ((Parent.Width - Child.Width) 2)
Child.Move iLeft, iTop
End Sub
But the Child Form is not in Center Position. (Refer Attachment)
Please guide me to rectify this.
Thanks in advance.
Updating Parent Form From Child Form
I have a button that invokes a secondary form
Private Sub cmdPreview_Click()
frmChild.Show
End Sub
no in frmChil i want to calculate some values and be able to
update some of the fileds in the parent caller...
How do u do that in VB.
do i have to make the form modal ? or can i still do it using the same way it is calling it.
Setting Parent Of Modal Form?
I have already created my application and as each form is show, I show it as modal such as frmMain.show vbModal. Is there any way to show all of these forms within a main form now and be able to minimize it all from the main form in the background? Or when you show a form as modal, this cannot be done? I hate to change the way all of the forms are shown. How do you show a form in modal state in another one though than can be minimized?
Thanks
Finding The Parent Form From A Modal Show
Hi,
Is there any way to find out the parent form from the child form, when you load a modal form.
IE...
When I show a form like this...
frmListsSearchItems.Show vbModal, frmListsMaintEdit
Is there any way for the frmListsSearchItems form to know that it was loaded from the frmListsMaintEdit form?
I know that I could keep track of it manually, just woundered if there was something like frmListsSearchItems.parent around??
Thanks,
Rob D.
ProIV Resource Centre www.proivrc.com
Why Can't An MDI Child Form Be Modal?
I am building a multiple document interface with a classic main toolbar with the likes of File, View, Project, etc. along the top.
When the application first opens up I am showing a welcome form that gives the user a choice of either starting a new project or opening an existing one. However this form should be modal, that way the user cannot press any of the buttons on the tool bar until he/she has chosen a project. However it says MDI Child forms cannot be modal, so do I have to make the welcome form a non-child form or is there another reasonably simple way?
Modal MDI-Child Form, Is It Possible?
Hi
I want to show an MDIChild form which should behave like a modal form. How can I restrict other windows to become active without closing the concerned MDIChild form.
Please Help me.
MDI Child Form As Modal??
Hi,
I want my MDI Child form as Modal form in vb 6.0, can i get it
it can be an api or any ways to attain that?
any one can help me out
"Unless you try to do something beyond what you have already mastered, you will never grow."
Regards,
Vish....
Parent Child Form
I've got quite a large access database with a number of tables accessed through ado. I'm wanting to relate and display these tables so that for each parent record the child records will be displayed in a grid. Also for each child record there are a number of tables related.
The database is constructed similarly as follows:
Table A - Userid(Primary Key), Name, Telephone
Table B - Assetid(Primary Key), Typeid, Userid(Foreign Key - Related to Userid in Table A)
Table C - Typeid(Primary Key), Type(Foreign Key - Related to Typeid in Table B)
The parent will be the records stored in table A with the child being the records stored in table B. Table C is used for storing items to be populated into a combo box and is related to the Typeid in Table B.
How can I display the child records for each parent record?
Do you have to use a shape construct SQL statement or is there another way to do it?
Parent And Child Form ???
HI guys,
I am still new to vb, so I hope you will bear with me.
I have a project I am writing in VB 6.0
The mainform opens and i have buttons along the top for the user to click on , when they click on one, the associated form opens up just fine.
The thing is, is it does it in it's own area, that is, it is not opening up within the main form.
Does this make send to you guys?
Anyway, if it does, how do I get all the forms under the buttons to open up as kind of a part of the main form?
thanks,
Kevin
Modal Form Properties
Say I have 3 forms; Frm1, Frm2 and Frm3 - Frm1 being my 'main' form.
Frm1 has the ability to show the other two forms, and Frm2 can show Frm3. Frm2 and Frm3 both need to be both shown as modal forms, but if Frm2 is shown as modal, then Frm3 can't be called by Frm2. How is it possible to give forms modal properties other than not allowing another form ontop of it?
(setting the Enabled property to False will still make the form go on top from the task bar)
Sunny
MDI Child's Movement Around Parent Form
Hey,
I have a MDI Form, with a Child inside. The child needs to be opened and unloaded several times throughout the session.
But everytime it is loaded again, it has move down horizontally a bit, which means that some of the form has been chopped off by the parent.
Does anybody have any ideas on how to stop the child from moving? I have tried setting the StartUpPosition, but everytime i select an option it says 'Invalid PRoperty Value. I have also tried positioning it using the little computer screen down the bottom right, but to no avail.
Any help is much appreciated.
Thankyou.
Size A Child Form Within Parent
I have an MDI application in which I have a child form that will always remain on one section of the screen. When the user presses buttons etc I want other forms to open in the remaining space in the MDI form. I'm having trouble trying to figure out how to make sure the 2nd child form fills the remaining space in the MDI form. I've tried the following code:
Private Sub Form_Load()
' Form2 is the child form which is always open
Me.Move Form2.Width, 0
Me.Width = Screen.Width
Me.Height = Screen.Height
End Sub
This seems to work well unless scrollbars are enabled in the MDI form. When this is the case there are scrollbars when there don't need to be.
Any ideas? Thanks.
Parent - Child MDI Form Problem ( Looks )
In My Project there is a Parent MDI and several child MDI
I am having serious problem in their looks .. I have attached a simple FORM with 1-2 child MDI and a login / logout form
All i want to do is..
1) the Parent should be maximized when program runs.. or in a good size compared to the user screen
2) In startup of MDI all mnu should be disable except the "login" mnu and "exit" mnu
3) When a person logins all mnu should be enabled and login should be disabled
4) When a person clicks on form1 or form2 . the current loaded form should close and the form should open
5) the size proportion between the child MDI and parent MDI should be good looking..
this is for my college project and i just want good looks..
someone please modify this project example and reupload so that i can assess it and see how it is done
i m desperate.. ive tried many things in child / parent MDI but looks do not come well..
help me here...
Mdi Child - Set Center Of Parent Form
ok, i'm trying to set a mdichild form to the center of its parent form
i've tried the start-up position but it just gives me the error 'Invalid property value'
is there a general way of making the mdichild appear in the center of its parent form easily?
Thanks
Parent Child Data Form
Hi all,
I'm somewhat new to VB, however, am quite experienced with ASP. That poses
some problems. I am trying to create a form in VB that would be simple to
create on the web.
I want the form to basically look just like a standard parent / child form.
However, the grid part is different. I want something like this.
It is a hierarchical recordset that has totals and such.
I will never how many SytemDescription levels there are or SubSystem
At the top I would have a button to add a system. All of the below are
variable. There could be any number of systems or subsystems of each system.
This would be easy in ASP cause I could just dynamically build the table I
can accomplish this without the buttons in a report. I just don't know how
to do it in a form. Can I create the individual controls to build the table
at run-time like I can in HTML / ASP. Please help!!
SystemDescriptionButton to add a subsystem
SubSystemDescriptionQtyPriceAdjPriceTotal button to add or subtract
quantity
SubSystemDescriptionQtyPriceAdjPriceTotalbutton to add or subtract
quantity
etc.....
SystemTotal
SystemDescriptionbutton to add a subsystem
SubSystemDescriptionQtyPriceAdjPriceTotalbutton to add or subtract
quantity
SubSystemDescriptionQtyPriceAdjPriceTotalbutton to add or subtract
quantity
etc.....
SystemTotal
etc etc......
total
Thank you Joe
Binding Parent/Child Form
Hi, guys! I'm trying to build an application using vb6 and my problem is i cannot bind my parent form to its child form. Here's my problem.
I have a main form called "Local Customers". Then below the controls or text boxes is the data grid control called "Orders".
What I really want to do is to have a subform just like what I do with microsoft access.
Hope you can help me.
Thank you very much.
By the way, I'm using Win98 and my database is MS Access 2000.
How Do Close A MDI Parent From A Child Form
Trying to exit the app if the user clicks the Exit button on the child form.
I've tried...
Unload Me
Unload frmMain
But this results in an error...
Only one MDI form allowed. Err # 426
How do I close both forms and quit the app?
Thanks
AccessGuruCarl
Programmers helping programmers
you can't find a better site.
MDI Form . Relation Between Parent And Child
hi
I would like to create a form that will present main data in the parent window and some records of detial in the child form.
1)How do I create the forms?
2) How do I set the relation between them.?
For example:
Tthe main form will present an order information with customer name and order id .
The child form will present some line, each is a record with part name.
(All data is from acess table)
Make VB Form An MDI Child Of An MDI Parent In Another App
I have this strange need to make my non-mdi child Visual Basic form an MDI child of an MDI parent form that belongs to another application.
I have successfully changed the window style to child using the Windows API SetWindowLong. I have also successfully used the Windows API SetParent to set the form's parent to the MDI form in the other application.
But in the other application, the form's title bar will not show focus (i.e., turn blue) when the form has focus, and the form will not always repaint completely. The form continues to function correctly in all other respects. I've tried changing the form's HInstance to the instance of the app I'm making it a child of, but that doesn't help.
Any ideas on what additional things I need to set?
Thanks very much!
Update Parent Statusbar Through Child Form
I have a status bar on my MDI parent form (FrmMain). I want to update Panel(1).Text through code in one of my child forms. I get an error only one MDI form allowed. How can I update the status? I don't want to inlcude a statusbar on every child form as I really only need it for a couple of instances.
Please help....
Pass/get Info From Child And Non Parent Form
I have an MDI application with parent Main and children Formulas. How do I communicate information from the child to another form Materials which is a non child dialog form. I also need to pass info back to Formulas from Materials. I keep getting a "form instance does not exist error" which I understand but I simply can't figure out how to expose everyone to each other. Formulas = me.ActiveMdiChild works fine in Main but I can't expose the active mdi child of Main to Materials.
10 hours down the tube and counting.
Moving Child Form's(x,y) To The Centre Of Mdi Parent
Hi i need to move a (x,y) position of the child form to the centre of the mdi parent form. without resizing the child form.
please help me to find a solution
regards
claude.
Edited by - claude_vbcity on 4/11/2005 12:03:12 AM
I Cannot Get The Foreign Key Reference In A Parent/child Form
I have a parent/child form that I have created without using classes in VB. When I want to add a new record, I click on ADD. I have a DAOcontrol.Recordset.addnew function for both the parent and child form. When I create a new record, I do not get a foreign key reference in the child form. The parent primary key is an autonumber from MS Access. This is the foreign key in the child form but doesn't appear. So when I call up the parent that particular child is missing. Can anyone help me
Can An OCX Refer To Parent Form Properties?
Howdy all,
Anyone know how an ocx can refer to the properties of the parent form it is placed on?
I've written a custom control based around a standard textbox with a few other custom properties and wizzy bits. It has a Locked property which both locks the textbox and changes its background colour to ToolTipsYellow which is our standard.
I'd like it to be smart enough to lock itself though so rather than having to do
me.txtBox.Locked = True for all my custom textboxes on a form or looping through the forms controls collection I'd like to be able to set one property on the parent form and have all the custom textbox controls spot it and lock themselves.
I've found the Ambient properties object and the Parent object but I'd like to be able to refer to a public property of my own on the parent form. Any ideas?
Tim.
To Open The Parent Formwhen Child Form Is Closed
Hi,
I have two forms.
1. frmA
OK button and cancel button
Sub OK_Click()
frmA.Hide
frmB.Show
End Sub
2. frmB
Ok button and Cancel button
Sub OK_Click()
frmB.hide
End Sub
Sub frmB_Terminate()
frmA.show
End Sub
when i close frmB using window close button, i want to show frmA. I tried with frmB_Terminate(). Now, my problem is even i click Ok button terminate() is executed and frmA is still opened.
Can anyone suggest me how handle this case.
Anandi
Child Forms To Resize When Parent Form Is Resized
Child forms to resize when parent form is resized, I have been searching for this since last night.
I have seen many posts and solutions on it, but none have worked for me.
I am not sure if I even have the Mdi/Child relationship set up right on my forms
If some would look at my source and help straighten this out that would be great!!
When I start app everything is where I want it, but if I resize parent the child forms do not resize with it?
please help.
I am also having issues with my dropdown menu being hidden by the child forms, but that issue is next, I desparetly need to resolve the resize problem first.
Thanks so much!
Make Child Forms Not Resize In The Parent Form
How do I make the child forms that start up in the parent form be the same size that I made them. When I launch the program the child forms startup small and cut of some of my controls. I want them to start up just like they appear in the design mode.
ComboBox/datagrid Parent/child Relationship In A Form
Howdy - I must be screwing something simple up here...I am very new to VB, have done the searching but haven't found what it is I'm hosing. I have a global connection declared in module1:
Code:
Global cnObj As New ADODB.Connection
Public Const ConnStr = "Driver={Microsoft ODBC for Oracle};" & _
"Server=servername.world;Uid=username;Pwd=password;"
and in form1 I have a Comboboxthat loads a list of usernames from a worequest table:
Code:
Private Sub Form_Load()
Dim rs1 As ADODB.Recordset
Dim SQLStatement As String
SQLStatement = "select worequest_username from worequest_user"
cnObj.Open ConnStr
Set rs1 = cnObj.Execute(SQLStatement)
Do Until rs1.EOF
Combo1.AddItem rs1.Fields.Item("worequest_username")
rs1.MoveNext
Loop
cnObj.Close
End Sub
which works perfectly. Thing is, when the user selects a username from Combo1, I'd like Datagrid1 to display * from the worequest table where username = Combo1.text..so:
Code:
Private Sub Combo1_Click()
Dim rs2 As New ADODB.Recordset
Dim SQLStatement As String
Dim curVal As String
curVal = Combo1.Text
SQLStatement = "select * from worequest where worequest_username = '" & curVal & "'"
With rs2
.CursorLocation = adUseClient
.CursorType = adOpenDynamic
End With
cnObj.Open ConnStr
Set rs2 = cnObj.Execute(SQLStatement)
Set DataGrid1.DataSource = rs2 'this line is highlighted upon error below
cnObj.Close
When this is run the combobox has the values I expect, but the onclick generates:
Run-Time error '7004'
The RowSet is not bookmarkable.
Which I read as really saying "you putz. Go back to playing with crayons."
What am I screwing up? Thanks in advance for any assistance, and for this wonderful resource
Click On Parent Form And VB Still Thinks Screen.activeform Is The Child
My program has the option to view an exhibit in a second form that can pop up if the user hits the PIC button on the main form.
There's a timer on the child form that constantly checks if it's still the screen.activeform so that the person using the program can just click away from the child form to kill it.
It works okay as long as the user clicks an active part of the parent, like a check box or a text box. The weird thing is that if the user clicks on part of the form that's just blank space or a disabled button, the parent form returns to the deep blue top border that would make you think that it's now the activeform, but actually, the child is only hidden behind the parent and if you go to the immediate window, the child form name still comes up as the activeform.
Even stranger is that it used to be that you could click on any part of the parent and the child would properly find out it was no longer active and unload itself.
I'm thinking it must be something in the properties of the parent, but the only two things that seemed relevant were enabled and key preview and toggling both those didn't help.
What's the dealio?
|