dbTalk Databases Forums  

Convert a String to a Form

comp.databases.ms-access comp.databases.ms-access


Discuss Convert a String to a Form in the comp.databases.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Dave
 
Posts: n/a

Default Convert a String to a Form - 02-26-2008 , 03:12 PM






Hello Folks,

This may be a really simple thing, but I haven't found the answer.
Perhaps you'll tell me my approach is all wrong. Either way, I am
stumped and need some help, please.

I have multiple, similar 'dashboard' type forms that call code, open
other forms, etc.

I have a process in which a secondary form is opened by actions on the
dashboard, and then, depending upon choices made on that secondary
form, code may be called to make changes to a table and then the form
that originally started the process. I have been storing the dashboard
form name in a hidden field on the secondary form, how can I use that
String version of the name to open a form object in code that will
refer to the original form?

Thanks

Reply With Quote
  #2  
Old   
Allen Browne
 
Posts: n/a

Default Re: Convert a String to a Form - 02-26-2008 , 04:36 PM






Assuming you have the name of the form in a textbox named txt1, you can
refer to the still open form in the background like this:
Dim frm As Form
Set frm = Forms(Me.txt1.Value)

Or you can make it the current form with:
Forms(Me.txt1.Value).SetFocus

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Dave" <dahaskins (AT) gmail (DOT) com> wrote

Quote:
Hello Folks,

This may be a really simple thing, but I haven't found the answer.
Perhaps you'll tell me my approach is all wrong. Either way, I am
stumped and need some help, please.

I have multiple, similar 'dashboard' type forms that call code, open
other forms, etc.

I have a process in which a secondary form is opened by actions on the
dashboard, and then, depending upon choices made on that secondary
form, code may be called to make changes to a table and then the form
that originally started the process. I have been storing the dashboard
form name in a hidden field on the secondary form, how can I use that
String version of the name to open a form object in code that will
refer to the original form?

Thanks


Reply With Quote
  #3  
Old   
Dave
 
Posts: n/a

Default Re: Convert a String to a Form - 02-26-2008 , 04:52 PM



Thanks Allen!

I knew it would be a simple answer, but it was eluding me nonetheless.

I've already plugged that into my code with success.


Reply With Quote
Reply




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 On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.