|
-
March 28th, 2001, 08:04 AM
#1
working with 2 forms in a project
i created 2 forms in a project. one form called frmMain and other is frmCustom.
form frmCustom have the textbox input for "height" and "width".how do i get the values from "height" and "width" in frmCustom to the other form "frmMain"?
-
March 28th, 2001, 08:16 AM
#2
Re: working with 2 forms in a project
You can refer to any control of any loaded form by name thus:
public Sub CommandResize_Click()
me.Width = frmCustom.txtWidth.Text
End Sub
HTH,
Duncan
-------------------------------------------------
Ex. Datis: Duncan Jones
Merrion Computing Ltd
http://www.merrioncomputing.com
-
March 28th, 2001, 08:45 AM
#3
Re: working with 2 forms in a project
If I'm reading this correctly you are entering values in a textbox on one form and want to get those values to another form? You can either reference the first form frmMain.text1.text = frmCustom.text1.text or create a global variable in a module to capture the values on frmCustom and transfer them to frmMain as below:
In code module:
Public strHeight as String
Public strWidth as String
In frmCustom after entering value:
strHeight = text1.text
strWidth = text2.text
In frmMain:
text1.text = strHeight
text2.text = strWidth
-
March 28th, 2001, 10:12 AM
#4
Re: working with 2 forms in a project
hi,
thanks. by the way, you wrote:
In code module:
Public strHeight as String
Public strWidth as String
is it writting the above in the "standard module" .bas?
-
March 28th, 2001, 10:21 AM
#5
Re: working with 2 forms in a project
Yes. Put the variable declations in a bas module.
-
March 28th, 2001, 11:00 AM
#6
Re: working with 2 forms in a project
what is a bas module? i mean when should i use bas module and when i should i not use it?
-
March 28th, 2001, 04:23 PM
#7
Re: working with 2 forms in a project
Use a BAS module to declare ojects globally for use anywhere in your application. Just select Project|Add Module and save it as a .bas file.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|