Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    Visual Basic




Problem In Opening One Form From Another Form


Hello All
I'm using VB 6.0,Windows 2000 and MsAccess.

I've following two forms:

1)Form1
in this form there is a button called Open.
2)Form 2
in this form i have used the Tab dialog control.There are 3 different tabs
Tab0,Tab1,Tab2
and each tab contains one frame,one grid,command buttons.

I've to do the following operation:

When user clicks the button "Open" in form1
form2 should be opened in the following format:
3rd Tab should be highlighted and
3rd tab frame should be visible and enable
3rd tab Btn1 and Btn2 should be visible.

I've the following problem:

Form2 is opened in the desired format but frame is disabled eventhough enable is set to true.
I've observed the following issues by putting the break points:

but when mouse is takes over the code:
1)me.frame.visible=true
it shows me.frame.visible=false
2)me.frame.enable=true
it shows me.frame.enable=true

but in runtime frame is disabled.


Kindly help me to solve this problem

Thanks in advance

Regards.




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Disabling All Form's Control Or The Form Upon Opening The Form.
Hi There

Here is my Objective (What I want to accomploish).
Upon opening a Form Called “Search”, the Curser gets focused on a ComboBox called “comboTrans”, And the user must select a value form the ComboBox before they are allowed to move to any other Control. (That is all)
Off Course since the form is an Unbound, They should be able to close the Form any time they wish, Even thou, they have not selected any value from the ComboBox “comboTrans” yet.

I tried many different events of The control and the form itself.
The closest that I came to reach the above objective was in Lostfocus Event of the control itself, But It causes problem when the user decides to close the Form before entering any values ‘for any reason”, the Control’s msgBox Keeps Popping Up.

Therefore I decided a different technique;
And that is Upon Opening the Form, Basically disable or Lock all the controls in the above Form or the Form itself, Except the ComboBox. Then setting the focus on the Active ComboBox, and Even if the User moves to other control, with the help of a MsgBox Forcing the user to move back and select a value from the Active ComboBox
And in the AfterUpdate event of the ComboBox make all other controls Enabled or active again.
A note the form has No record Source and the Control itself is unbound and has No Control Source.

Best Regards
Sanan




Edited by - sanan on 1/6/2005 7:25:56 AM

Opening A Form Within A MIDI Form An Infanate Amount Of Times
Hello,
I am stumped right here at this point since this is my first time using a MIDI form setup.

My question is: How would I open the same form within a MIDI form an infanate amount of times, and on each new opening the form caption would change accordingly (ie.) Untitled 1, Untitled 2, Untitled 3.

Thank you for who answers


------------------
- M e n S h e n
Canabatech Programmer

Homepage http://influx.virtualave.net
Email essex@seedesigns.com
ICQ 17527422

Control Stays With The Parent Form Even After Opening The New Form
Hi,

I am facing a problem in my VB application.

Here is the issue:

I have one form "frmResult" which has the third party Thumbnail control and another form "frmImage" which displays the image. Here both the forms are MDIChild.

Now, whenever user clicks on the Thumbnail in "frmResult" form, "SelChange" event of the thumbnail Control in "frmResult" gets fired and it creates the new instance of the "frmImage" and displays image in it.

Though it seem that "frmImage" form has focus, but clicking on the "frmImage" form (keeping the opened "frmImage" form to it's default position) selects the thumbnail beneath the "frmImage" form and fires the "SelChange" event for the selected thumbnail control of "frmResult" and opens new "frmImage" form for the selected thumbnail.

What i have seen when i debug this issue is, "Deactivate Event" of the "frmImage" gets executed immediately and the control stays with the "frmResult" form.

What i want is once the "frmImage" form opened by clicking on the thumbnail that form should have the control.

Information About A Form Without Opening The Form
I am trying to get information on a form (width and height) but I can't seem to access that info without the form being open.

Solution B is to create an procedure that will open all necessary forms, read their width and height, and put that into a table that can be read later, then close the forms.

I would prefer to not have to do solution B...any suggestions?

Opening A Form/project From Another Form
is there anyway to open a form from another form. i don't mean show it. i mean as if the form was not running then you open it.

also can you do this with a project. can you open a project from a form.

thanks a lot

Opening 2nd Form From 1rst Form
i'd like to open a second form but keep getting unhandled exception

this is what i do
dim form2 as form
form2.show()

then i get the following message unhandled exception type system.nullreferenceexception

what is wrong??

please help

thank you

Opening Form Using Data From Another Form
I posted this in the wrong forum:
OK
I'll try to explain this correctly.
When I click on a certain line in my DBgrid from a certain form it must open this data in another form.
Ummmmm
Well it's claer when you know what I want.
Hope my question is clear enough as it is now.

Opening A Form But Not Give It The Focus (or Quick Tell Me Wich Form Has The Focus)
Opening a form but not give it the focus (or quick tell me wich form has the focus). Is this possible??

Opening A Form Within A Form
This is my first post and I'm a beginning programmer. In one of my programs that I am doing in my Adv. Apps Class is to make a logon screen and then have 3 hints. I have the hints setup in the Drop-down menus at the top and would like to know how if the user clicked that hint menu, I would open up another window with that in there. (I don't want a message or input box)

Opening A Form Within A Form
Hello,

How do I open a form within a form? I have a form called "frmHelp.frm" and when a user clicks on the "Help" button, I want the "frmHelp.frm" to load up within the main form.

Thanks

Opening A Form From Another Form
Having just started VB, I get easily confused by all the big words, so to anyone answering: please make it simple! (I'm only 17yo, if that helps)

OK: I really, really can't be bothered using MDIs/child things, etc, is there another way to open another form separately (using Private Sub Command_Click() )?

If you need more detail, I've made an animal survey, and I want a button to lead to another survey that I've made.

Please help, or else I'll give up and go and cry in a corner.

Opening A Form
Hello all!

I'm importing some code from Access to VB (the default swichbord), the problem I run in to is trying to finr a method to open a form where the form's name in a variable.

Here is the Aceess code:

Case conCmdOpenFormBrowse
DoCmd.OpenForm rs![Argument]

I already try this:

Case conCmdOpenFormBrowse
Load rs![Argument]

but as you all know (and by now me too... ) it didnt worked....

Any idas people?

Thanks a lot!

Opening A Second Form
I'm trying to open a second form from within my main form using docmd as follows:
' go to the next form
Dim stLinkCriteria As String
stDocName = "Form2"
DoCmd.OpenForm stDocName, , , stLinkCriteria

My intent is to do some processing in Form2, then return and continue on in form one. What happens is: Form2 opens, but the code continues to be executed in my main form as well (with no wait for the return of Form2). Why?

Is there any way to stop the main form from executing until Form2 is done?

Thanks,
Mark

Opening Another Form
Hi, everyone. I have a little problem.
When i have this line:


Code:
Private Sub TrafficLights2_GotFocus()
Form4.Show
End Sub

I open the form4. But the problem is that I can not close it. I close it and, it's comes up again. What should I do?, any ideas?
Thank you.
Félix

Opening A New Form In VB6
Hi All,

How do I open a new form up in VB 6.I managed to get Form2 to open with the "Form2.Show" code on a command button on Form 1 but Form 2 opened up behind Form 1 .Is there any code I can use that will open up form two then possibly a link on Form 2 to close it and make Form 1 re-appear.

All help really appreciated

Stiggo

Opening The Same Form Again And Again
is it possible to create a single form then on the click open it, again and again. like the windows in msn messenger?


Thanks

Opening A New Form?
I have a question about opening forms in my project? I have a command button and when it is clicked I want it too open Form2. I knew how to do this before but forgot, anyone that could help thank you in advanced.

Opening A Form More Then Once?
You know how in word you can have multipal documents open? Say I have a MDI project, and I have a new command, and it is suposed to open a form named frmnew, how can I tell it to open that form like 10 times, if I were to click the NEW button 10 times?

Opening A New Form
Right, I have it set so when the program starts there is a kind of welcome screen, then i have a button which says "Click Here to start" now i want the button, when pressed to close the current window and open a new one. Sorry this must seem really easy for you lot.

Form Opening
hey. I am making a program where you input the # of forms you want open in a text box.. and that # of forms open.. please tell me how I do that.

Opening A Form
I can't figure out how to open a form from within an application. All of the help I can find assumes that you know how to create a form object. I know that I need to use the form1.show() procedure, but how do I create form1?

Opening App From Vb Form
Hello All,

I am trying to create a vb form that will open an application. I have tried the code:

Private Sub cmdStart_Click(Index As Integer)
Dim retval
retval = Shell("c:program filesapplicationstartup.exe", vbnormalfocus)
End Sub

The problem is that the application does not open, however, when debugging I found that it was returning the value of a process that it was starting.

I tried the basic calculator example:
dim retval
retval = shell("c:winntsystem32calc.exe", vbnormalfocus)
this worked fine.

I have taken the path from the script and pasted it into the run line and that also works.

There is other functionality that is required, but this aspect is the most important. Any assistance would be greatly appriciated.
Specs:
vb 6 on win2k

Thanks in advance
Brandy

Opening A Form Inside...
Is it possible to open a form (.frm) inside of a different EXE than the primary one.

Example:
Project1.exe-Form1 shows/loads = Project2.exe-Form1

If it is possible please help me

Opening A Form Next To Current
How do i move my 2nd form so it its sitting touching to the right of my first form?

Thanks

Error When Opening A Form
Hi all,

I have a program coded by VB. When I double click on the main form, it raises an error. Some thing like this:"The instruction at '0x00589ddb' referenced memory at '0x6c6584b1'. The memory could not be 'read' ".

Please let me know why? and how to fix it?

Thanks a lot.

Opening A New Window With Same Form
I am attempting to get a graphing routine to work. It plots well, but if I attempt to send a second set of data to the screen to plot, while leaving an old plot on the screen, it plots the new data on top of the old.

I'd like to be able to leave the old window with the old graph on the screen, and open a new window for the new graph. This requires using the same form in two windows. Is there some way that I can add a line of code to get the graphing form to show up in a new window each time I call the graphing function that in turn plots the data on the graphing form?

At present I simply send the data to the form via a function associated with that form, then use the "show formname" command to display the form.

Thank you.

Opening A Form Using A Variable Name
Hi Everyone,

I need help accessing a form using a string variable.

I have a table that contains a list of all of the available forms. When the user clicks on the specific lbl command, it refers to the table and retreives the corresponding form name.

Once I identify the form name, I want to be able to active the form with that name. But when I reference the variable name, it tells me I have a Data mismatch error. Can anyone help me?


Code:
Private Sub lblOptions_Click(Index As Integer)
sql = "SELECT * FROM [MenuLoad]" _
& " WHERE (([LevelBoardID] = '" & Me.txtLevel & "')" _
& " AND ([ItemNumber] = " & Index + 1 & "))"

rs.Open sql, sConn, adOpenKeyset, adLockOptimistic, adCmdText
Dim MyForm As Form
Set MyForm = cstr(rs!FormName)

MyForm.Show
rs.Close
Set rs = Nothing
End Sub

Opening A Form And Closing Another
I'm working on a program that has a "welcome" form and an "order" form. I'm trying to get the "welcome" form to close and open the "order" form when a button is clicked on the welcome form. I can't figure out the right code to do this. Any help is appreciated.

Opening The Same Form In A New Window
how do I open the same form onto a new window and close the existing form...???

Opening A DOS Window On A VB5 Form
Is there a way i can open a DOS prompt inside a VB Form?

And if there is how can it be done?

Thanks anyway

Opening .doc Form Vb Access
How do you open a Word document from vb in access.

I just need the code. I have an idea but I don't have the right code...

I know it's with the App oblect or something like that...

Opening Access Form
i have a little program in access forms, and now i want to open all those forms in visual asic.. anything like vb.access.forms("test").show but it isnt open how can i open the forms made in access in visual basic:??

Opening New Form & Using Data For It...
Probably an easy question for you guys, but I'm a beginner and tried the MSDN library. I've got my main form and on my 4th tab I want to click a button that will load a new form that I've created (say it's called Form2.vb) First how do I do that? -- sure that's easy...

Secondly, what all would I need to do in order to put a pie chart on there from data that will be input into form1 by the user? I know the code for the pie chart but basically need to know how to "export" that data into Form2 so the chart will show.

Hope that was semi-clear and hopefully we can get some help here. Thanks guys, any help is much appreciated...

Opening A Form In A New Thread
I am working in VB.Net and have the following problem.
I would like to show a status screen when performing actions such as db queries, data manipulation, etc. I present a form as a splash screen, but when accessing the database, the spash screen and the animations freeze while waiting for the database to return the information I need.

I am new to threading and would like to set up my calls to the database on a new thread, but would also like that new thread to update a progress bar on my splash screen.

Anyone seen any good examples of this or have any suggestions how I can do this? I would like a way to present the progress to the user for each of the steps I do.

-Andy

OPening Form With Parameters
I want to open a form with a parameter (integer) so i can use it for opening a query on the database how can i do this?

Opening The Form From EXE File
Hi Group,

I need to be able to open from my form a form thats currently in .exe file. I can't find the code on how do it. Any help would be greatly appreciated.

Private Sub cmdScan_Click()
Command ("G:***Sheet.exe")
End Sub


thanks

Opening A Connection From Another Form
Is it possible to open a database connection from another form but adding records is in other form? If it is, pls. tell me. its urgent

Im using a coded ADODB Connection to store records. i plan to open the db connection from Form1 and save records from Form2. its is possible?

Opening And Filling Out IE Form
I am building a VB exe and in it i have a command button that currently opens a web page in a separate IE window. What is the code I can add have same command button to also paste information from my form into a certain field in the web page. so for instance it the field inthe web page is called

(theForm.Fname.value == "")
so would it be ?

Code:


Private Sub btnSubmit_Click()
On Error Resume Next
Dim RetVal
RetVal = Shell("C:Program FilesInternet ExplorerIEXPLORE.EXE http://mywebsite.com", vbMaximizedFocus)
AppActivate RetVal, True

setfocus.(theForm.textbox1.value == (label1))
setfocus.(theForm.textbox2.value == (label2))
and to just put text into a field in the web page:
setfocus.(theForm.Fname.value == "my name")



Also how would I select an option from a dropdown box in the web page through this same command in my vb exe file?

Opening A Modal Form
While opening a modal form from a modeless form, mouse pointer converts to hourglass. Although can access optionsbox, command button etc. But how can I prevent mouse pointer to be same as arrow?

Thanks
Sameer

Opening A Picture In Another Form
I have form1 and form 2.

i want to load a picture in a picturebox in form1 from form 2 . then i want to add textboxes dynamically with :


VB Code:
Set Txt(i) = Me.Controls.Add("VB.Textbox", "cmdButton" & Me.Controls.Count, Form1.Picture1)                    With Txt(i)              .Left = x              .Top = y              .Width = 60              .Height = 5              .Text = k              .Visible = True              .BorderStyle = 0              .BackColor = &HFF8080              .SetFocus                  End With



is : Set Txt(i) = Me.Controls.Add("VB.Textbox", "cmdButton" & Me.Controls.Count, Form1.Picture1)


correct?cause it hits an error on form1.picture1.whats wrong?

Opening Form On Formload
Ok. so i have a form "frmPOS". I have this code:


VB Code:
Private Sub Form_Load()    NewTransaction = True    If NewTransaction = True Then        frmTransStart.Show        frmTransStart.SetFocus    End IfEnd Sub


That opens form "frmTransStart". the problems is, that frmTransStart is underneith frmPOS.

I tried SetFocus, but that didnt work. any suggestions?

Opening New Form Without Offset
How do you make it so that when a new form opens it opens right where the old one was, not with a slight offset?

Opening Form Question
VB Code:
'button on form 1Private Sub Command4_Click()'need something here to open form2End Sub


and then on form2:


VB Code:
Private Sub Form_Load()'check if the Check1 on form1 is ticked, if its ticked, close form1End Sub


any ideas guys?

Opening A Form Using Variable Name
On my Main Menu screen, i have two list boxes. Box2 displays the options based on the option selected in Box1.
When the user double clicks the option in Box2, it should open up a form.

I am trying to do this using a variable to store the form name.

var1 = "frmUsers"

for each frm in Forms
if frm.name = var1
frm.visible = true ' (or load frm)
end if
next


The above code does not work and says Type Mismatch when it reaches the if frm.name = var1 line in the code.
More over, i have 23 forms in my project so far, but i can see only 3 when i do forms.count

Your help will be highly appreciated.

Form Not Opening Maximized
I have a multi-form application, and use a DAO connection to an Access database. One subroutine is run when users click a command button on form Page 7. An Excel worksheet opens and data from form Page 6 is sent to the worksheet. My problem is that when users save and close the form, the application now shows Page 6 loaded rather than Page7, assumably because the last code run reference Page 6.

To correct this, I added two lines of code to the end of the subroutine:


VB Code:
Unload frmPage6      frmPage7.Show


It does the trick except that frmPage7 is not maximized. This is irritating. The windowstate is set to maximize in properties. Is there a way I can set this at run-time?

Form Reloads After Opening *help*
Ok I have a form that opens and a timer that runs and does things in the background while the form is open.
when I unload the form named "Dialog" I do the following

Timer1.Enabled = False
MakeNormal Me.hwnd
Set Dialog = Nothing
Me.visible = False
End Sub

The timer even has some loops with DoEvents in them.
After the unload it still goes back and finishes the timer sub which ends up kicking off the form load function again and the form opens.
how do I stop it from doing this?

Thank you
Garrett

Error Opening Form
Every time I try to load into VS a form I get the following error :

"Class.....was not a loaded control class"


Can anyone suggest to me whats up ?

TIA

Error Opening A Form
Here is the problem I am having. I have a MDI,when the user clicks a command button returning the
user to the application main form they get an error that reads:

Common Language Runtime Debugging services.
Application has generated an exception that could not be handled.

Process ID = 0x2a0(672) Thread ID = 0x6ec(1772)

When the user clicks ok the application ends.

Here is part of my problem. This only happens randomly maybe one time in 50 to 100 times on going from
one form to the main form, also I have not been able to duplicate this error in the development environment. It only
seems to happen when an exe is deployed to a user machine.

Here is the code that is being used in a form to take the user the the main form


Private Sub btnHome_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdHome.Click
Dim cmdBuilder As New SqlCommandBuilder(adpRelease)
adpRelease.Update(Me.dtRelease)

Me.Close()
End Sub

Protected Overrides Sub OnClosing(ByVal e As System.ComponentModel.CancelEventArgs)
Dim frmMain As New frmMain()
frmMain.Show()
Me.Hide()
End Sub



Thanks for any help any one can give me,

Al

Opening Form With Data?
I have a general purpose form containing a MSHFlexGrid with selected records from a very large table. If I click on a row in the grid, I can select the appropriate record in the recordset.

Upon selecting a record, I fill an array with the appropriate data, dim newRecordForm as new FormRecord. The next section of code should send the array to the newRecord form and fill the textboxes.

I KNOW I CAN....create code that will fill the textboxes such as

VB Code:
newRocordForm.txtBox(1).text = me.array(1)


However, it is often necessary to create multiple "newRecordForm"s and populate them with data. If I use the previous code example, there is a confusion which newRecordForm I want.

Is there a way to send the array to the newRecordForm during the newRecordForm.show statement?

I don't want to use public array's

Copyright © 2005-08 www.BigResource.com, All rights reserved