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

Connecting Multiple Forms

hey guys,

I have different forms in my project like form1,form2...etc and an mdi form in a project.
I want to create a link from the menu of the mdi form to all the other forms.

I tried giving:


but getting the error "invalid method or data variable"

solution plz.

View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Connecting Multiple Forms With A Line?
I suspect that the answer is "What? Are you brain damaged?", but maybe it can be done...

If I have several small forms, can I draw a graphic line connecting them like a flow chart? I mean short of using one of the "skin" solutions I have found posted here? IOW, if the answer has the word "hwnd" in it I probably won't understand it.

Just a passing thought, please don't neglect your family and career to work on this day and night for six weeks and then post a complete sample of a working system.... unless you really want to...

Data Grids, Multiple Forms And Multiple Repeat Forms

We are in the early phases of development and have come across an interesting situation that we could use some assistance. I will try to explain as brief as possible and provide more information as needed.

We are trying to create data grids that has one primary parent form. The parent form has multiple "sub-forms" (best way to desribe, not MDI's) requesting data input from the user and certain "sub-forms" can be repeated multiple times. The issue is how do we queue the data up and be able to store the information in multiple tables?

This particular routine is for a data input wizard that we have created for the user - in other words all entry for this application is handled through this wizard; whereas the rest of the application is there to search, view, edit, print the complexity of data from the entry process.

While "how do we do this?" is one question, we are open to new ideas to re-think what we have done. If anyone has suggestions as to where else to post this question we would be willing to go in different directions too. Please feel free to answer directly to this group and my email address.

Thank you for your feedback.

Connecting Forms In .Net
I am trying to write something that will open screen (form), while a bunch of arrays are being allocated. When the arrays are allocated, I want the first screen to go away and a second one appear. Actually, the application is going to have a lot of screens poping up and going away. Can anyone point me towards a piece of sample code that shows this kind of screen control? I am doing this in .NET



Connecting Two Forms
Hi All

Someone know?
How to connect two forms - I want to connect one to second - because then it possible the moving a first Form together with a second Form. Similarly like in the Swedish Gimp

I have something like this
in Module

Option Explicit

Public NewWidth As Long

Public Sub CentreForm(F As Form)
NewWidth = FrmMAIN.Width + Form2.Width
F.Move (Screen.Width - NewWidth) 2, (Screen.Height - F.Height) 2
End Sub
Public Sub ReturnCentreForm(F As Form)
F.Move (Screen.Width - F.Width) 2, (Screen.Height - F.Height) 2
End Sub

In FormMAIN for Picture1 and Picture4 (arrows)

Private Sub Picture1_Click()
ReturnCentreForm FrmMAIN
Picture3.Visible = True
Picture2.Visible = False
End Sub

Private Sub Picture4_Click()
CentreForm FrmMAIN
Picture2.Visible = True
Picture3.Visible = False
End Sub

For Form2

Private Sub Form_Load()
CentreForm FrmMAIN
Form2.Left = FrmMAIN.Left + FrmMAIN.Width
Form2.Top = FrmMAIN.Top
Form2.Height = FrmMAIN.Height
End Sub

Private Sub Form_Unload(Cancel As Integer)
ReturnCentreForm FrmMAIN
With FrmMAIN
.Picture3.Visible = True
.Picture2.Visible = False
End With
End Sub

All works nicely, it lacks me this keeping only

thanks in advance

Connecting Forms
i have created two form...


The Welcome form has one button called: "GoOnIn"

When a person clicks on the button, 'GoOnIn' i want a macro to close the Welcome Form and Open the ChooseTeams form.

How do you do it?

Connecting 2 Different Forms.
suppose i have to forms. in the first form i have a command button,if i click that button i have to get the second form.
pls help me.

Connecting To Multiple Databases In Vb6
Just wondering if its possible to connect to various different Access databases
using VB and to update these databases at once.Does anyone know where i
could find sample code to do this

Thanks 4 ur help

Connecting To Multiple Databases

I'm using VB6, a JET Access database and ADO.
I am trying to connect to 2 different Access dbs. The reason for that being the first one is used to draw information and fill a flexgrid and the second is used to log information. I cant put the logfile/log table in the first database because I have to allow the user to specify the folder where they want to have the logfile/db created. Is it possible to have 2 connections to 2 separate dbs at the same time?

I already figured out how to create a new db with a log table in the new location(specified folder) etc when the program is run. I just need to connect to it now to write information to it. I have tried setting up the 2nd connection but it seems to interfere with the first one? And I cannot close the connection to the first database as I'm using information from the recordset. So I just wanted to know if 2 connections are possible and if so, i must have stuffed up somewhere

Alternatively, if I cant do that...I was thinking of creating a log table in the first db and then copying it to the specified location/folder when the user exits the program. Is that a bad idea? Hope my explanation is clear enough. Thanks for your time and help guys!


Edited by - junjye on 11/10/2004 10:56:48 PM

Multiple Forms And Multiple Winsocks Question...
I'm trying to write a client that uses multiple forms. In effect, it is a hybrid client/server that allows for interapplication communication without the use of a central server.

However, I'm having trouble getting to grips with how I should approach this, and what sort of design pattern one could use, or if there's any examples.

This is what I want to do:

1) Have a server socket that listens.
2) Have a command parsing socket that receives a connection from the server socket
3) Depending on the command analysis of the parsing socket this socket should open one of three different kinds of forms.
4) The parsing socket should establish itself as the data transfer socket for the opened form.

This is a .Net aircode snippet that I've written to sort of understand the problem, but I'm writing this app in VB 6 because I must use Winsock and because the one I'm writing it form doesn't want to install the .Net framework.


Public Sub Listener_ConnectionRequest()
If Listener.State = SocketStates.sckCOnnected then
dim temp as integer = socketArray(socketArray.GetUpperBound(0)+1)
ReDim socketArray(temp)
End If
End Sub

Public Sub Socket_DataArrival()
Dim strDat as String
If Socket.State = SocketStates.SckConnected then
End If
End Sub

Private Sub ParseData(strDat as Sting)
Dim cmd as String
cmd = Microsoft.Visualbasic.Left(strDat,4)
Select case cmd
Case "chat"
chat = new frmChat
chat.Socket = Socket
Case "file"
fil = new frmFiles
fil.Socket = Socket
Case mesg"
End Select
End Sub
VB6 just won't let me assign the socket as I do in the above code. And of course, it reports an error already in the IDE when I try to Set it.

Anyone with any ideas?

I'd appreciate it.


Connecting Multiple Clients To Server
i m making a client server application where server contains an array of sockets and are listening at different ports. when client connects to the server, it tries to connect at different ports (those defined in server side) till it gets connected. but only one client gets connected, other fail to get connected. here is code :
p = 500
for i = 1 to 10
tcpserver(i).localport = p
p = p+1
-- client --
sub connectToServer()
c = 0
tcpclient.remotehost = serverIp ' whatever the ip is
For p = 500 To 510
tcpClient.RemotePort = p
p = p + 1

While tcpClient.State <> sckConnected
c = c + 1
If c = 10 Then
c =0
GoTo reconnect
end if
If connectedToFileServer then
Exit For
End If
end sub
Private Sub tcpClient_Connect()
connectedToFileServer = True
End Sub

Connecting To Multiple Com Ports Using Threads
i need to fetch data from comports and so need connect to multiple ports.can any one tell me how to connect to the ports using threads.i need to connect to around 4 virtual ports.I also need to fire the mscomm events for each port connected.

It urgent

Connecting Vb 6.0 Forms To Ms Access 2000
1. i'm having a project at university as i'm in final year,i have the problem in connecting the forms i designed in visual basic 6.0 to my database created using access 2000,may anyone guide me to that plz .

2. may again someone help me how to design a (Ms access 2000)database driven web page with visual basic 6.0.


Connecting Text Boxes From Two Different Forms
I have three forms, each containing the fields for seperate tables (a foreign key included on two of the forms) and I want to be able to connect the two forms to the main form using command buttons. I've been able to do this by using the ".Show" command, but then the two forms show all the records rather than just the record that matches that from the previous form. Does that make sense? Is there some way to reference the data from the text box of one form to the text box of another form?

Please help when you get the chance!


National Center on Physical Activity and Disability

Need Help Connecting Multiple Clients In Chat Program
I'm rather new to net coding in VB6 and I have a problem. I read the tutorial on the now-dead awhile ago, and I have just made a few changes to it myself. I was trying to make it so that multiple clients could connect to one server, and it would act sort of like IRC. But, I'm having an odd problem. I made it so that whenever a client sends some text, instead of sending it out and assuming it got to the server and adding it to the "sent text" box itself, it would just send it to the server, and then the server would send it back to ALL clients, including the one that sent it. This solved two problems, 1) making the sender sure that his message hit the server and 2) removing the specific client from the loop to send his message to other clients. My problem then is, that for some reason the server only communicates with the most recent client connected unless forced otherwise. An example of this can be seen here:

Private Sub Winsock_DataArrival(Index As Integer, ByVal bytesTotal As Long)

Dim strData As String
Dim i As Integer

Winsock(Index).GetData strData
strData = strData & vbCrLf
txtSaid.Text = txtSaid.Text & strData
For i = Winsock.LBound + 1 To Winsock.UBound
'There is an array of winsocks, winsock(0) is always to remain open to recieve
'incoming connections, if it is accepted, then a new winsock is loaded
Winsock(i).SendData strData
Next i

End Sub

Let's say 2 clients were connected to the server. If I were to send a message from any client, the server would get it, but would only send the recieved messages to the most recent client to connect. I've shown this with a screenshot:

Here is the code I have from showing how to load more winsock controls if more clients connect:

Private Sub winsock_ConnectionRequest(Index As Integer, ByVal RequestID As Long)
Dim i As Integer
Dim j As Boolean
j = True

For i = Winsock.LBound + 1 To Winsock.UBound
If Winsock(i).State <> sckConnected Then
Winsock(i).Accept RequestID
j = False
Exit For
End If
Next i

If j = True Then
Load Winsock(Winsock.UBound + 1)
Winsock(Winsock.UBound).Accept RequestID
End If

End Sub

I though that it might be disconnecting the clients for some reason, and as you can see in the screenshot I made those 6 command buttons that are coded like this:

Private Sub ws1_Click()
Winsock(1).SendData "Test WS1"
End Sub

Private Sub ws2_Click()
Winsock(2).SendData "Test WS2"
End Sub

Private Sub ws3_Click()
Winsock(3).SendData "Test WS3"
End Sub

Say clients 1 and 2 were connected, and only client 2 was getting all the data the server was supposed to be sending all clients. As soon as I hit the client 1 button to test if it's still connected, all the data that was supposed to be sent earlier gets sent (or recieved) when I hit the test button. I've gone over my code several times, and I've searched multiple forums and eangines, only to learn that searching for specific problems is pretty useless.

I think I have shown everything that one would need to know what is going on and possibly know a fix. (If not please tell me what needs to be added) Any help is greatly appreciated!

Multiple Clients Connecting To Winsock Server?
Is it possible to have multiple clients connecting to the same winsock server?

Maybe I should explain my situation in order for you to fully understand my question...

There are at least 3 computers. One will act as a "server" that will need to communicate with the other computers (I'll call them "clients").

The server will send messages to the "clients" so that they can perform general commands (determine if the hardware connected to that client is ready, determine if the hardware is in the load position, etc, etc). It then needs to relay this information back to the "server" so that the server can tell the "client" what it needs to do next.

The problem I'm running into is that the Winsock control only seems to allow one "client" to connect to the "server" at a certain time. Does this mean that I will need a seperate "server" instance for each "client"? Am I missing something here?

Is there a better way to do all this?

Thanks in advance!

Connecting Multiple Computer And Sharing A VB Program
Hi, I need my program to be shared by several computers accessing my VB project. What I did was using a hub and netbui, I set up a network and shared a folder with my files and got the other computer to access it. The thing is, I keep having problem with Win 98 and Win 2000.. Usually Win 2000 can see the 98 computer, but 98 have a hard time seeing 2000.. In the case I want the "server" to be the 2000 computer, it might be hit or miss whether the 98 computer can access the 2000 computer.. Also, the end users might not be computer literite enough to set up a network. Does anyone know any other file sharing protocol that can be used and that might be easier to set up than what I'm doing?

Multiple Users Connecting To Server App With Winsock.
My server app only allows one client to connect to it at once. How can I have it accept multiple users?

Connecting 3 Different Forms &amp; Tables From One Database Using Textboxes

Here's what I've created so far:

1. The Start Form gives the user a choice of three categories.
2. Choosing one of these categories will bring up one of three Category Forms - Citations, Programs, or Equipment.
3. Each of these three forms is linked to the same three tables in one single database.
4. Each of these three forms gives the user the ability to edit data in the underlying database.
5. Each of these three forms displays some data from the database
6. Each of these three forms contains two buttons, one each for address and phone.
7. When the user clicks on either of these buttons, they are taken to a form which deals specifically with either address or phone data (regardless of the initial category).

I'm trying to make this possible:

When the user clicks on either phone or address buttons, the address or phone ID which was last displayed in the category form is automatically displayed in a text box in the address or phone form.

Right now all I have for the two buttons is, so it displays all the records instead of the one specifically accessed from the previous form. I am using mySQL and DBTools along with VB. Please take a look at the attached files or and let me know if you have any suggestions! Thanks so much for your time!

National Center on Physical Activity and Disability

Multiple Timers And Multiple Forms
Hi, all,

Please help me with this issue.

I have three forms f1, f2, f3. On each form there is one timer, t1, t2, t3, respectively. All forms have been loaded. When f1 is shown and f2, f3 are hidden, are t2 on f2 and t3 on f3 still working? Assume t2 and t3 are not disabled explicitly within code.

Thanks a lot!


Multiple Forms/modal Forms
Is it possible, say, to have two forms show up at one time (one on top of the other), then after completing the top form, dismiss it and bring up another form on top of the bottom one?

Also, is it possible to change the modality of the forms?

Using VBA in Excel 97.


Which Is Better Multiple Forms Or Mdi Child Forms ?
hi ,
i am building a form which will need multiple forms working on top of each other ..
i would like to have your suggestion as which is better to use multiple forms or multiple child forms ?

Multiple Forms

I am struggling to find a way to create copies of an existing form that i can keep track of during run time.

This is the code i have to make copies of the form:

Dim NewForm As Form
Set NewForm = New frmChat
NewForm.Visible = True
Unfortunately all the forms have exactly the same name, which means i cant control specific forms.

Anyone got any ideas?

Thanks in advance.

Multiple Forms
in my game, i created 1 form and then added a new form
form1 and form2
how do i make it so that form2 "knows" all the objects on form1?
when i write a line of coding in form2 that uses objects on form1, it says in the error message that an object is required.

DX, And Multiple Forms
I started coding DirectX in VB about 3 hours ago, so I hope this is an easy question to answer:

I have a form, (frmMain), which is the startup form. In this form, I am setting the screen res, initializing dirextX, and setting the cooperation mode.

<pre> Set DirectDraw = DirectX.DirectDrawCreate("")
Call DirectDraw.SetDisplayMode(800, 600, 32, 0, DDSDM_DEFAULT) </pre>

When I then try to call another form:


the MessageBox form is being loaded and displayed, yet its being hidden by the main form.

I assume this is to do with how im setting the cooperation mode, (I have also tried frmMessageBox.SetFocus after showing it, which had no effect).

I believe the problem lies in the DDSCL_EXCLUSIVE flag, but I'm just not sure, what to change it to.

Any help would be appreciated, thanks.

Multiple Forms
I'm writing a game, just a simple basic one.

When the user presses the "cmdRoll" button, It initiates a Private Sub called RollDice

however, when its the players turn, it then needs to load another form, which asks the question - and closes when it is answered. after it is answered I need it to go back to the RollDice sub, or another Sub in that forum.

What I need to know is, how do I start a sub that is in one form, from another form.

Multiple Forms
If i have multiple forms, e.g Form1, Form2
and i declare a adodb.connection variable in form1,

do i have to declare it again in form2 to use it in form2?

i open form2 by doing

dim forma as new form2
forma.Show vbModal, Me

Multiple Forms
Im, writing a chat program. I just made the instantmessenger boxes, I can't get the instantmessenger boxes into an array, so I can have multiple of them open. Does anybody know how to do this?

Or have it creat a new one?



More Multiple Forms
its me again

I have 2 problems

1) I have 2 forms. one form, you set the pizza up, the other form prints a "summary" for the ordered pizza. The 2 forms work at the same time, and you can switch between them
now. I made so when I click "add pizza" in one form, it sets the focus on the other (the other form has the code to add the pizza under the activation function) then sets the focus back. the problem with this is that if you switch to the other form without meaning to add a pizza (ie, clicking on it) it will try to print a new pizza. so to fix this, I created an activation variable, so, when I click "add pizza" i make "a = 1" and in the frmsummary, I said if a=1 then print the pizza, if not, then do nothing. Its a great idea, but I cant get it to work, its like the computer doesnt recognice wether a is 1 or 0. I "a" in a module as integer

2) I cant transfer strings, i mean. I could transfer single strings and values (such as prices and customer names) but i couldnt make a "multiple" string to transfer between forms. I mean by multiple strings, something like, putting 2 strings together and printing that result. In my example, i need to transfer "PIZZADONE", which is a string composed by Pizza and top_name. I declared PIZZADONE in a module as public, and told it to print

in other words, here is my program. take a look at frmSettings and frmSummary. Look for the "red dots" and give it a try.

Please if you can help me out

Thanks in advance

Multiple Forms Help

im making a program with multiple forms

I type in customer information and when click continue i store them in variables, then switch forms.

I want to print the stored variables in the new loaded form. So I put print the variables in picture boxes under the frm_load routine, but the variables dont print.

I tested making a command button called "RETREIVE iNFORMATION" and it basically has the same code as in the frm_load, just under the cmd_click, and it works perfectly.

so, the varialbes are stored properly in the previous form, but it seems that the new form is not executing the frm_load routine.

any help on this?

thanks a lot

Multiple Forms
When I'm dragging from one form to another, is there anyway that I can activate a form when my mouse gets over it? What I'd like to do is drag from Form1 to Form2 but I when I try, Form2 isn't active so I can't tell where to drop the item? Any ideas? Thanks, Jeremy

Multiple Forms In VB
I am creating a project with mulitple forms. I would like the person to enter a week ending date in the first form. Then by clicking the command button go it will search the database and change to the next form which will fill in a box for the week ending date and populate a list box with available information for that weekending date.

I have my date saved under the general declarations of the first and second forms. I am saving it fine in the first form but i can not get it to transfer to the second form.

Any help would be great!


Multiple Forms --&gt; How To Get Them

im am trying to make a note app with vb6.
now i have a note form, wich stays topmost.
this form will be duplicated like this:

on newbutton_click
Dim n As New notiz
SetWindowPos n.hwnd, HWND_TOPMOST, 0, 0, 0, 0, TOPMOST_FLAGS
end sub

now, this all works..i can make several notes, and they stay all on top.
but, how can i acces them from the main form, for save it or anything?
in fact, how can i create a index changing array, wich holds all the instances?

it is not an MDI app...and it never will be one

btw. i tried to make the form topmost or not by a button. but it will change
on EVERY instance or on the false one or otherwise ... --> it works up to three instances but not there any fix to this problem?


Multiple Forms
ok so whan i had just started, i went throggh all the sample projects that were available on vbenterprise 6. I found that there was a wordprocessor like sample program. When you click new the code is

private sub mnufilenew_click()
load newdoc
end sub

theere is a frm document form with a rich textbox in it also. This loads up in the mdiform as many times as you want ie as many times as you click on new. It gives you lots of the same form. How would i encorperate this into a paint like program to load a new document where you can keep the existing one open?

Multiple Forms?

i have a slight problem that i've been dealing with. i have one form, that i need to 'clone' into multiple forms at runtime.
an example would be a user clicks a button and for each time the button is clicked a new form pops up. for me the ideal way would be to use an array of type form but that hasnt worked very well. i read the vb6 help file but it wasnt too helpful.

i thought about writing the form as an activeX control but it needs to be a real form, not just part of a form. if that makes any sense at all.

if you could help that would be great

Multiple Forms
ok so i am makin a picture viewer thing and am haveing a main mdi form and pictures being loaded up in the same form but at the same time, example: like a form above a form that is the same form but with a different picture in it, would i have to make an array of some sort? i have no experience here!

Multiple Forms
teaching myself VB 6...

making a program with 2 forms:
form1 asks for an input via textbox, form 2 will display the input via label
having trouble figuring out how to get the form1 input into the form2 output

any help would be awesome thanks a bunch!

Multiple Forms..
How do i make it where if the user is viewing form2 when they click the close button in the title bar it will close form2 and show from1 and not exit the application.

Multiple Forms ??
Ok my friends and i started a project of instant messenger they are making server and im making client... When i receive messages from others on the client i need to open the form where we talk each time for each user... (hope you understand my english) i found tutorials explaining how to use multiple forms in but didnt found in 6.0... is there a way to make it and if so how ? thanks

Multiple MDI Forms (VB6)
Hello, I was wondering if anyone knows how to make multiple MDI forms in VB6. I swear I saw an application that loads multiple MDI forms (written in VB6), and I was wondering if anyone here knows what I need to do to accomplish this.

I know that say you have a form you want to load multiple instances of, you simple do

Dim f as Form
Set f = New Form1
Set f = New Form1

But VB6 does not permit multiple MDI forms as far as I can see..

If anyone can help, I'd greatly appreciate it.
Thanks for taking the time to read my post!!!

Multiple Forms..
this is my first thread and post, so hello to everyone..

I have 2 active forms and both should use the same port. Is this possible in VB6 or the only solution is to combine the 2 forms in one? please help..

Multiple Forms!
A VB project has 3 Forms - frm1, frm2 & frm3. frm1 is the start-up Form. When a menu is clicked in frm1, frm2 gets invoked. frm2 has a CommandButton whose Caption is "Enabled". When I click this CommandButton, frm3 gets loaded where in I do something & after closing frm3, the Caption of the CommandButton in frm2 changes to "Disabled". Now suppose I have the following code in the Form_Activate event function of frm1:
VB Code:
Private Sub Form_Activate()    MsgBox frm2.Command1.CaptionEnd Sub
Now when frm1 loads for the first time, the MsgBox correctly shows the Caption as "Enabled". Next I invoke frm2 & then frm3 & after doing something in frm3, the Caption of the CommandButton in frm2 changes to "Disabled" when frm3 gets unloaded. But now when I come back to frm1 after unloading frm2, the MsgBox still says that the Caption of the CommandButton in frm2 is "Enabled" though it has already changed to "Disabled"!

Why so? How do I make the MsgBox in frm1 show "Disabled" when the Caption of the CommandButton in frm2 has changed to "Disabled"?

Multiple Same Forms..
Hello, it has been awhile since I have posted here and was trying to think of the places I could ask for help at since all the others didn't help to well. Alright, well anyways I wanna open multiple forms, using the same form over and over again. The thing is.. I need to know if that form has already been open with a certain tag/key. Is it possible?

Multiple MDI Forms?
is it possible a project has a multiple MDI forms? any idea?... i have a project named ERP. which holds multiple Programs... ex. user login: Accounting, an Accounting Program will open. if user login: Technical, a Technical Support program will open...

want to create in just one project... any idea how to do this? tnx in advance

Using Multiple Forms
how multiple forms can be loaded same time.. with one main form...

Multiple Forms Help Please
I'm trying to create a project kind of like a web page.
where there is a form with a bunch of buttons like a start page.
i want to make it so that when i click a button it will hide ther current form and bring up a new form. what do i need to do for code?

thank you for your support

Multiple Forms
I want to be able to make multiple instances of the same form, this possible?


Multiple Forms
Hello, i am having toruble with display 3 instances of the same form. I always thought it could be done buy this

Private Sub Command1_Click()
Form2.Show, 3
End Sub
but this dont work, any1 know how to do this?

Multiple Forms
I am making a PDF browser but i have a problem:

i have created a form with a pdf control on it but everytime the user opens another document i want the app to simply create another instance of the form but with a different document in the pdf control! how do u do it?

i feel realy stupid because i am sure it is really easy! Thanks

Multiple Forms
I am making a PDF browser but i have a problem:

i have created a form with a pdf control on it but everytime the user opens another document i want the app to simply create another instance of the form but with a different document in the pdf control! how do u do it?

i feel realy stupid because i am sure it is really easy! Thanks

Copyright 2005-08, All rights reserved