Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

changing constants

Status
Not open for further replies.

cochise

Technical User
Mar 27, 2001
171
US
I have about 30 constants for various company defaults. I want the user to be able to change these constants, if necessary, by means of a form and a save button. I have declared the constants in my one module.

1) How do I set up a form that will display and allow me to change the constants and then save them?

2) Because I need to access the constants in the code behind my forms, should I declare the constants as Public or Private?

 
Hi!

If they can be varied, then by definition they are not constants. What you have is a set of parameters. What I would do is set up a table of parameters to hold the default values and create a form to display them and allow the users of your choice access to change them. If you keep the form open and hidden, you will have an easy way to access the parameters in code using Forms!ParameterForm!YourTextBox. If one of the users allowed to change the parameters wants to, you can add a button on your main form which will make the form visible. You will want to add a button to the parameter form(called Apply) which will update the record and hide the form again.

hth
Jeff Bridgham
bridgham@purdue.edu
 
Thanks for the help. How does one go about changing the forms property to hidden?
 
When you open it, change the default view to acHidden, e.g.

DoCmd.OpenForm "MyFormName" , , , acHidden

Check to see - I think it's the fourth option, not sure exactly.

Ex-JimAtTheFAA
78.5% of all statistics are made up on the spot.
Another free Access forum:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top