Results 1 to 3 of 3
  1. #1
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    Alzano Lombardo, Italy
    Posts
    1,483
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Referencing constant values throughout a project (2000)

    If you take a look at the control source for the Rend and Rend2 text boxes on the RDezzo report in the attached mdb you'll see the report works only if the Dezzo form is open because it relies on the constant values set in the salto text box on the Dezzo form and the salto text box on the MG1Dez form. Isn't there a way to use a couple of constants that can be referenced throughout the mdb?
    Attached Files Attached Files

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Referencing constant values throughout a project (2000)

    In the version as attached, the values in the Salto text boxes are fixed at 240 and 42, they cannot be changed by the user. So you might as well use 240 and 42 in the report. Another way to do it would be to create a small table with some "constants", say tblSettings with two fields: Setting (text, primary key) and Value (number)

    <table border=1><td>Setting</td><td>Value</td><td>Salto1</td><td align=right>240</td><td>Salto2</td><td align=right>42</td></table>
    You can use DLookup to retrieve the value of one of these settings: <code>DLookup("Value","tblSettings","Setting='Salt o2'")</code> will return 42. The control source for the "rend" text box on the report would be

    <code>=rendi([Energia],[PORT1],[Pmedia],DLookUp("Value","tblSettings","Setting='Salto2'") )</code>

  3. #3
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    Alzano Lombardo, Italy
    Posts
    1,483
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Referencing constant values throughout a project (2000)

    Grazie Hans! <img src=/S/clapping.gif border=0 alt=clapping width=19 height=23>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •