Calling form function from modul files

roka
08-03-2005, 03:36 PM
Hi-

New at VB, have been searching for a while to resolve this issue,
trying to call a form_unload function from an added module file, complier error is "sub for function not defined".
Question is, how can a function from a module file call a function in the any of the form files.
The function being called is deplared public.

Thanks a lot.

Diurnal
08-03-2005, 03:43 PM
You can call public functions of forms by using intellisense (type the form name and use the dot syntax). If you know the name of the form, it would look like this:

'In Form1:
Public SomeFunction() As String

'In a module:
Dim sText As String
sText = Form1.SomeFunction()

You can unload a form in the same way:

'In another module:
UnLoad Form1

roka
08-03-2005, 04:45 PM
This worked. Thanks again.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum