Link to home
Start Free TrialLog in
Avatar of Bob_Gardner
Bob_Gardner

asked on

Reference Data from Dialog Box to Main Form

I have a form (frm_MainLog). When selecting one of the records to close from that form, I have a dialog box (popup, modal) that is opened and requires information to be entered in a specific format. The dialog box (frm_Input) is unbound and has one textbox field (CaseNumber). I do not want to use the inputbox method (which I have been using), as it does not permit me to use an input mask to insure that the data is entered in the specific and correct format.
I now need to move the input data from the dialog box textbox to a string variable in the code of the form (frm_MainLog). The variable is [sresponse] (where it is later concatenated with another variable, before being posted to the appropriate field in frm_MainLog)

The problem I am having is
 (1) how to reference the dialog's textbox and post the data to the main forms declared variable, then
(2) close the dialog without having to add any command buttons to the dialog. (do I close the dialog box in frm_MainLog code, or use an AfterUpdate event in the dialog box code?)
Would appreciate the help.
Bob
Avatar of rockiroads
rockiroads
Flag of United States of America image

u can do one of two things

define a global variable in a module

then use that in both your forms

or define a public procedure in your form, then call that passing in your inputted text
this public procedure will then set the variable


this all done on the OK button, after that, u close the form DoCmd.Close


Just a thought, feedback purposes only, I wondered why u gave a C when I suggested using a unbounded box and which is what your doing now
ASKER CERTIFIED SOLUTION
Avatar of Markus Fischer
Markus Fischer
Flag of Switzerland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Bob_Gardner
Bob_Gardner

ASKER

The answer I received from harfang was presented in such a manner that I was able to fully understand the dynamics. To say that it worked, is an understatement. I modified his suggestions in several ways, including using comboboxes in the input form to restrict, even further, the type of acceptable information.
As a result, I have INCREASED the points to 500 and graded the answer "A".
I have also, extended my apologies to rockiroads for the "C" grade that I gave, through my own ignorance, of the question that preceed this one. That apolgy is posted as a comment in the orginal question.
Thank you, Bob_Gardner, for your compliments and also for the ponts. I'm glad you liked the explanations. If you feel that way about rockiroads and your previous question, you could send a little note in http:/Community_Support/ titled "Please reopen", with only this line:

    Please reopen {http:/Q_21851601.html} to let me change the grade.

They often do it within minutes, it's really quite frequent.

Good luck with your application!
(°v°)
Harfang,
Thanks for the info. I have do so!
Bob