Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old January 8th, 2006, 03:34 PM
TheAlchemist TheAlchemist is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: May 2005
Posts: 24 TheAlchemist User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 7 h 47 m 7 sec
Reputation Power: 0
Two forms and using functions between the two

Ok I have two different forms and I want to pass a value from one form to another. I am passing information from a sub to a function with no return.

It says my function is not declared. I dont understand what I am doing wrong I had the sub private as well as the function in the other form. But I tried making them both public and it says the same thing.

Can someone please tell me how you pass values between forms.

Thank you.

Reply With Quote
  #2  
Old January 9th, 2006, 03:38 PM
Alias-Zero Alias-Zero is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Sep 2005
Location: localhost
Posts: 40 Alias-Zero User rank is Lance Corporal (50 - 100 Reputation Level)Alias-Zero User rank is Lance Corporal (50 - 100 Reputation Level)Alias-Zero User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 14 h 44 m 12 sec
Reputation Power: 4
Send a message via ICQ to Alias-Zero Send a message via AIM to Alias-Zero Send a message via MSN to Alias-Zero Send a message via Yahoo to Alias-Zero
Is the function in a module?

Edit:

Not entirely sure what you want to do, but this should work fine if I understood you correctly:

[Form1]
Code:
Private Sub Command1_Click()
MsgBox LAUGH(1)
End Sub

Private Sub Form_Load()
Form2.Show
End Sub


[Form2]
Code:
Private Sub Command1_Click()
MsgBox LAUGH(0)
End Sub


[Module]
Code:
Public Function LAUGH(check As Integer)
If check = 0 Then LAUGH = "Yes!"
If check = 1 Then LAUGH = "No!"
End Function


Form1, Command1, when clicked will prompt a msgbox with "No!"

Form2, Command1, when clicked will prompt a msgbox with "Yes!"

Both use the same function, declared in the module.
Comments on this post
nofriends agrees: good explanation

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingVisual Basic Programming > Two forms and using functions between the two


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
Stay green...Green IT