|
-
Jun 6th, 2006, 09:35 PM
#1
Thread Starter
PowerPoster
Any way to get parent form calling module function?
Let's say I had function TextEncrypt...and I called it from frmTextEditor...is there any way I can do a check from within TextEncrypt to see which form called it so I know which form to assign stuff to? The function itself wouldn't be on any form, it'll be stored separately in a BAS module
Yeah, I know, a weird question...but if you read my other question you'll know I'm thinking about a multi-form "pseudo OS" and knowing which form called the function would make a lot of difference (as the data generated from that call needs to be kept private to each form in some cases :-))..currently in the brainstorming phase of design rather than any actual code (and if you remember from other posts, I'm not doing any coding anyway because my monitor's bust and I'm on a TV here :-)) but it doesn't hurt to glean information in advance so I'm armed and dangerous when the time is right to code :-)
I'm off to bed now, so I'll see what people say in the morning when I get up...hopefully there's a way to do this, but I'm sure I can rustle up something if not
-
Jun 6th, 2006, 09:41 PM
#2
Re: Any way to get parent form calling module function?
 Originally Posted by smUX
Let's say I had function TextEncrypt...and I called it from frmTextEditor...is there any way I can do a check from within TextEncrypt to see which form called it so I know which form to assign stuff to? ...
In TextEncrypt's procedure header add at least one argument and declare it as Form so you can call it like this:
TextEncrypt Me
or
Call TextEncrypt(Me)
The following is a sample function declaration:
Public Function TextEncrypt(frm As Form) As String
...
-
Jun 6th, 2006, 09:44 PM
#3
Thread Starter
PowerPoster
Re: Any way to get parent form calling module function?
I think I understand that...wasn't what I was hoping for but it's of course a doable option. I was hoping for something that I could put into the function itself to find out (so all the call has to do is send the info the function needs, rather than having to add form ID or such which was the alternative I was going to go with if no-one had other ideas) but as I said, it's an option :-)
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
|