Go Back   PCMech Forums > Help & Discussion > Web Design / Development

Need Some Help? Type Your Keywords Here:

Reply
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Old 05-08-2001, 12:15 PM   #1
Member (4 bit)
 
Nikotnby's Avatar
 
Join Date: May 2001
Posts: 15
Send a message via AIM to Nikotnby
CRASH VB How do I call up another form from a command button?

I want to call another form when I click on a command button. My project is very small so I don't think there's a lot of coding involved(8-10 forms) I don't need any daughter windows and the project will be an executable. Also, I get an "Object Required" error when compiling. Here's a sample code:
General Declarations
Dim msg1text as string
Dim msg2text as string
Dim msg3text as string
Dim msg4text as string

Form Load
msg1.text = "dfasd"
msg2.text = "dfasd"
msg3.text = "dfasd"
msg4.text = "dfasd"

Then in CmdText1
msg1.text = "dfasd"
msg2.text = ""
msg3.text = ""
msg4.text = ""
Help???
I get the error in CmdText1, msg1
Thanks

Duane

Last edited by Nikotnby; 05-08-2001 at 12:19 PM.
Nikotnby is offline   Reply With Quote
Old 05-09-2001, 03:37 AM   #2
SQL nutcase
 
mosquito's Avatar
 
Join Date: Sep 2000
Location: Belgium
Posts: 1,136
Send a message via AIM to mosquito
The code you supplied is perfectly fine. The error is probably caused by the fact that you didn't put the text boxes on the form.

also, the
Code:
Dim msg1text as string 
Dim msg2text as string 
Dim msg3text as string 
Dim msg4text as string
code is unused, so get rid of it.

Can you also be more specific when writing your post, it's pretty hard to determine what's wrong with so little information.
mosquito is offline   Reply With Quote
Old 05-10-2001, 09:35 AM   #3
Member (4 bit)
 
Nikotnby's Avatar
 
Join Date: May 2001
Posts: 15
Send a message via AIM to Nikotnby
CRASH VB

Mosquito,

Yes, there, indeed, are text boxes on my form. What I want the program to do is when I click on a command button, a message appears in the text box. When I compile and take out the Dim'ed messages, no text appears.

Duane
Nikotnby is offline   Reply With Quote
Old 05-10-2001, 10:21 AM   #4
SQL nutcase
 
mosquito's Avatar
 
Join Date: Sep 2000
Location: Belgium
Posts: 1,136
Send a message via AIM to mosquito
Can you mail me the sourcecode, because this way we are getting nowhere.
mosquito is offline   Reply With Quote
Old 05-11-2001, 11:01 AM   #5
Member (9 bit)
 
Great_One's Avatar
 
Join Date: May 2000
Location: Lexington, Michigan
Posts: 353
this should be simple enough. the following code worked fine for me.

Dim strText1 As String
Dim strText2 As String
Dim strText3 As String
Dim strText4 As String


Private Sub Command1_Click()
Text1.Text = "e"
Text2.Text = " "
Text3.Text = " "
Text4.Text = " "

End Sub

Private Sub Form_Load()
Text1.Text = "a"
Text2.Text = "b "
Text3.Text = "c"
Text4.Text = "d"

End Sub

the dim of the strings are not necessary unless you plan to use these variables
at some other point. i included them just to match what you were doing.
__________________
Certifiable
===========================================

Cisco CCNA,CCDA
CompTIA A+, Network+,Inet+,Security+
CIW Associate
IBM AIX certified
IBM Certified Specialist - p5 and pSeries Administration and Support for AIX 5L V5.3
IBM Certified Systems Expert - p5 and pSeries Enterprise Technical Support AIX 5L V5.3
Great_One is offline   Reply With Quote
Old 05-11-2001, 11:07 AM   #6
Member (4 bit)
 
Nikotnby's Avatar
 
Join Date: May 2001
Posts: 15
Send a message via AIM to Nikotnby
CRASH VB

We must all pay homage to Great_One!!

Thanks Much, I'll have to try it

If you need the actual source code,
let me know and I'll try and email it Monday
Also I have 4 text boxes, 5 command buttons and 4 image boxes on my Form!

Duane
Nikotnby is offline   Reply With Quote
Reply

Bookmarks

Still Need Help? Type Your Keywords Here:


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 07:17 AM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
SEO by vBSEO 3.6.0 PL2