A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

how to pass form name to a module?



 
 
Thread Tools Display Modes
  #1  
Old May 20th, 2010, 12:32 AM posted to microsoft.public.access
jon
external usenet poster
 
Posts: 640
Default how to pass form name to a module?

Greeting,
I want to display the current form name when clicke on a button in the form,
but I want to use a module for that? any help please!!!
  #2  
Old May 20th, 2010, 12:51 AM posted to microsoft.public.access
Jeff Boyce
external usenet poster
 
Posts: 8,621
Default how to pass form name to a module?

Jon

Something like (untested):

YourFunction(strName as String)
...


and to call it from within a form, on a button click, you could use:

Call YourFunction(Me.Name)

Good luck!

Regards

Jeff Boyce
Microsoft Access MVP

--
Disclaimer: This author may have received products and services mentioned
in this post. Mention and/or description of a product or service herein
does not constitute endorsement thereof.

Any code or pseudocode included in this post is offered "as is", with no
guarantee as to suitability.

You can thank the FTC of the USA for making this disclaimer
possible/necessary.

"Jon" wrote in message
...
Greeting,
I want to display the current form name when clicke on a button in the
form,
but I want to use a module for that? any help please!!!



  #3  
Old May 20th, 2010, 12:59 AM posted to microsoft.public.access
Dorian
external usenet poster
 
Posts: 542
Default how to pass form name to a module?

Call the function in your OnClick event.
Pass the form name as a parameter to your procedure or function.
Call DisplayFormName("formname")
-- Dorian
"Give someone a fish and they eat for a day; teach someone to fish and they
eat for a lifetime".


"Jon" wrote:

Greeting,
I want to display the current form name when clicke on a button in the form,
but I want to use a module for that? any help please!!!

  #4  
Old May 20th, 2010, 08:47 AM posted to microsoft.public.access
jon
external usenet poster
 
Posts: 640
Default how to pass form name to a module?

Thank you all,
but could you please provide full code? also, I want to to display the form
name in msgbox please?

"Jeff Boyce" wrote:

Jon

Something like (untested):

YourFunction(strName as String)
...


and to call it from within a form, on a button click, you could use:

Call YourFunction(Me.Name)

Good luck!

Regards

Jeff Boyce
Microsoft Access MVP

--
Disclaimer: This author may have received products and services mentioned
in this post. Mention and/or description of a product or service herein
does not constitute endorsement thereof.

Any code or pseudocode included in this post is offered "as is", with no
guarantee as to suitability.

You can thank the FTC of the USA for making this disclaimer
possible/necessary.

"Jon" wrote in message
...
Greeting,
I want to display the current form name when clicke on a button in the
form,
but I want to use a module for that? any help please!!!



.

  #5  
Old May 20th, 2010, 09:48 AM posted to microsoft.public.access
Alexander Achenbach
external usenet poster
 
Posts: 4
Default how to pass form name to a module?

Public Function MyFunction()
On Error Resume Next
MsgBox Screen.ActiveForm.Name
On Error Goto 0
MyFunction=0
End Function



"Jon" schrieb im Newsbeitrag
...
Thank you all,
but could you please provide full code? also, I want to to display the
form
name in msgbox please?

"Jeff Boyce" wrote:

Jon

Something like (untested):

YourFunction(strName as String)
...


and to call it from within a form, on a button click, you could use:

Call YourFunction(Me.Name)

Good luck!

Regards

Jeff Boyce
Microsoft Access MVP

--
Disclaimer: This author may have received products and services mentioned
in this post. Mention and/or description of a product or service herein
does not constitute endorsement thereof.

Any code or pseudocode included in this post is offered "as is", with no
guarantee as to suitability.

You can thank the FTC of the USA for making this disclaimer
possible/necessary.

"Jon" wrote in message
...
Greeting,
I want to display the current form name when clicke on a button in the
form,
but I want to use a module for that? any help please!!!



.


  #6  
Old May 20th, 2010, 05:17 PM posted to microsoft.public.access
Jeff Boyce
external usenet poster
 
Posts: 8,621
Default how to pass form name to a module?

It appears Alexander has provided this.

I'm curious why you've not posted the code you've already tried.

Are we creating this for you, something like a homework assignment, or
helping you create it?

Regards

Jeff Boyce
Microsoft Access MVP

--
Disclaimer: This author may have received products and services mentioned
in this post. Mention and/or description of a product or service herein
does not constitute endorsement thereof.

Any code or pseudocode included in this post is offered "as is", with no
guarantee as to suitability.

You can thank the FTC of the USA for making this disclaimer
possible/necessary.

"Jon" wrote in message
...
Thank you all,
but could you please provide full code? also, I want to to display the
form
name in msgbox please?

"Jeff Boyce" wrote:

Jon

Something like (untested):

YourFunction(strName as String)
...


and to call it from within a form, on a button click, you could use:

Call YourFunction(Me.Name)

Good luck!

Regards

Jeff Boyce
Microsoft Access MVP

--
Disclaimer: This author may have received products and services mentioned
in this post. Mention and/or description of a product or service herein
does not constitute endorsement thereof.

Any code or pseudocode included in this post is offered "as is", with no
guarantee as to suitability.

You can thank the FTC of the USA for making this disclaimer
possible/necessary.

"Jon" wrote in message
...
Greeting,
I want to display the current form name when clicke on a button in the
form,
but I want to use a module for that? any help please!!!



.



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 07:57 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.