Several Forms

  • Thread starter Thread starter DS
  • Start date Start date
D

DS

I have a form that is a number pad. Sometimes it's used to enter
dollars, sometimes numbers, sometimes percents. It's called from 25
different forms. Hence I have 25 different versions of this number pad
form. This is not good. I would like to get it down to one form. And
have a select case behind it choosing which action it does alon with
what form it does it to. I'm a little nervous with a Select Case with
25 different options. Does anyone have any ideas on how to best handle
this problem?
Thanks
DS
 
DS,
Why not just add a % button and a $ button, and an Enter button to your existing numpad
form
Typing in 13.45
Enter = the value is numeric (13.45)
% = convert 123.45 the format to percent (1345.00%)
$ = convert to currency ($ 13.45)

That way the one popup form would be useable in all data entry situations.
 
Al said:
DS,
Why not just add a % button and a $ button, and an Enter button to your existing numpad
form
Typing in 13.45
Enter = the value is numeric (13.45)
% = convert 123.45 the format to percent (1345.00%)
$ = convert to currency ($ 13.45)

That way the one popup form would be useable in all data entry situations.
A good suggestion but the bigger problem lies behind the Enter Button.
Each form has a different set of code that leads somewhere else, form
dependent. Thats where my real problem lies. Is Select Case my only
option here? How many Select Cases can I have before it gets funky, or
is there a better way?
Thanks
DS
 
DS,
To followup on Hal's suggestion. Call the same number pad form in dialog
mode from each of your many forms. By opening number pad form in dialog
mode, it pauses the code until the number pad form is closed.

A method I use (but I'm sure there is a better way), on the close event of
the number pad form, write the numeric value to a field on a hidden temp
form. When the number pad form closes, the code on the calling form will
continue. You can refer to the field on the hidden temp form on your
continued form.

Sample for one of your many forms
Form1_Click()
DoCmd.OpenForm "frm_Number_Pad", acNormal, , , , acDialog
'code will pause until "frm_Number_Pad" is closed

'call value written to form from "frm_Number_Pad"
msgbox Forms!Temp_Form.Temp_Value
'rest of your code
End Sub

**********************

Sample on your frm_Number_Pad form

Form_Close()
Forms!Temp_Form.Temp_Value = Me.Num_Value


Hope this helps.

David P.
 
Back
Top