Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

execute forms sub from immediate window - brain freeze 1

Status
Not open for further replies.

1DMF

Programmer
Jan 18, 2005
8,795
GB
Hi,

I've had a total mental block and can't even find a thread on Google to help.

I have a sub on a form I want to test, yet when using
?subname in the immediate window nothing happens, the sub doesn't run and I get no errors?

What am I doing wrong.

Thanks.
1DMF.

"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you."

"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!"

Google Rank Extractor -> Perl beta with FusionCharts
 
ok, brain unfroze! [lol]

form_(name of form) (sub name)

I hate those mental blocks!

"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you."

"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!"

Google Rank Extractor -> Perl beta with FusionCharts
 
just noticed a typo in my post, don't want to confuse anyone else..

answer should be...

Code:
form_[form name][b].[/b][subname]

I missed the dot (period) in the first post!

"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you."

"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!"

Google Rank Extractor -> Perl beta with FusionCharts
 
Better yet. NEVER PUT A SPACE in a form name or other access object. I have no idea why MS even allows this. It just causes problems. Thus

form_formName.subname
form_formName.propertyname
 
BTW. The reason that you have to do this is because a form, report, worksheet, document modules are all Class modules just like a custom Class.
 
ah, so you are calling a a method by using its Class name.

FORM_[FORM NAME] is the class, then the message-send (method to call) you use a dot then method name.

Thanks MajP - now it has been explained to me, it makes perfect sense.



"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you."

"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!"

Google Rank Extractor -> Perl beta with FusionCharts
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top