|
-
Apr 18th, 2008, 07:03 AM
#1
Thread Starter
Lively Member
What would stop a Public Function being seen?
I have a form (frmA) that has a public function in it, which is declared like this:
Public Function Init() As Boolean
In the code of another form (frmB) when I type frmA. VB isn't showing me a list of public functions declared in frmA. I've inherited frmA from someone else. Is there some option or other in VB that is stopping frmB from seeing the Init function in frmA? I've not had this problem before, I can refer to other public functions in other forms without problems.
-
Apr 18th, 2008, 07:04 AM
#2
Re: What would stop a Public Function being seen?
I have never seen it before either. Zip up the two forms and attach them.
-
Apr 18th, 2008, 08:01 AM
#3
Addicted Member
Re: What would stop a Public Function being seen?
i believe some reference may be missing, try this add another form in your project and copy all the codes from frmA to the new form and now try to call it from form b, or else just press Ctrl + F5 to find any problem with the code.
HTH
-
Apr 18th, 2008, 09:38 AM
#4
Re: What would stop a Public Function being seen?
The only reference require to access a Public Sub/Function on a different form is the form name. Example:
Code:
'On Form1
Private Sub Command1_Click()
Form2.ShowIt
End Sub
'On Form2
Public Sub ShowIt()
MsgBox "I am actually on Form2"
End Sub
-
Apr 18th, 2008, 03:29 PM
#5
Re: What would stop a Public Function being seen?
Sometimes an error somewhere in your code will prevent intellisense (the little dropbox that shows a list of functions/properties etc) from showing.
Save your project and try to compile and see if you have any errors.
-
Apr 18th, 2008, 04:12 PM
#6
Thread Starter
Lively Member
Re: What would stop a Public Function being seen?
There are no errors as it runs fine for debug. I can't post the forms here as the company I'm doing the work for wouldn't be very happy with that...
-
Apr 19th, 2008, 03:21 AM
#7
Re: What would stop a Public Function being seen?
 Originally Posted by bcass
I can't post the forms here as the company I'm doing the work for wouldn't be very happy with that...
Then there probably isn't much we can do. The problem you are describing is very odd and without being able to see it for ourselves our ability to provide suggestions is greatly limited.
If you open a new project, add two forms, add a public sub to one of them, can you call that from the other form?
I suspect you can.
-
Apr 19th, 2008, 05:52 AM
#8
Thread Starter
Lively Member
Re: What would stop a Public Function being seen?
That's the weird thing, I'm not having problems calling other public subs/functions from/between other forms. I'll try dumping the objects/code into a new form to see if that fixes it.
-
Apr 19th, 2008, 06:18 AM
#9
Re: What would stop a Public Function being seen?
 Originally Posted by DigiRev
Sometimes an error somewhere in your code will prevent intellisense (the little dropbox that shows a list of functions/properties etc) from showing.
This is a very good point.
If you have error trapping on, turn it off, and see if you can generate any runtimes that might be causing you problems.
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
|