Click to See Complete Forum and Search --> : Create sub main in a module


carolineon
September 4th, 2001, 02:38 AM
My GUI had a button called cmdExport in Form1. I want to create a sub main that refer to this button.
In a new module, I wrote :

Sub Main()
Form1.cmdExport
End Sub

However, when i try to make an .exe with Sub Main as the start up object, there's an error which refer to .cmdExport in Sub Main. The error message is 'Invalid use of property'.
Can someone please help? Prompt answer will be much appreciated.

Thank you.

Cimperiali
September 4th, 2001, 02:51 AM
'add the specification : .value = true
ie:
Sub Main()
Form1.cmdCommand1.Value = True
End Sub


Special thanks to Lothar "the Great" Haensler, Tom Archer, Chris Eastwood, TCartwright, Bruno Paris, Dr_Micahel
and all the other wonderful people who made and make Codeguru a great place.
Come back soon, you Gurus.

The Rater

carolineon
September 4th, 2001, 02:58 AM
Thanks a lot, Cimperiali !!

Thanks... :)