Results 1 to 6 of 6
  1. #1
    black272 is offline Novice
    Windows 10 Access 2007
    Join Date
    Dec 2021
    Posts
    5

    Question Expression fields referencing other expression fields. Shown vs Not Shown leading to issues.

    I have multiple expression fields. Some of the expression fields reference some of the other expression fields. When I have all expression fields "Shown" button selected the resulting query works fine. The issue is I want to hide some of the expression fields as they are only used as placeholders. When I de-select the Show button on the fields, and try and run the query, I get an alert asking me to enter parameters for the (now not shown) field. How can I hide these expression fields?

    Code:
    Placeholder1: Replace([CandyName],"Cherry Bomb","Bazooka Gum").... Show 'deselected'
    
    NewName: Replace([Placeholder1],"Bazooka Gum","Big League Chew")... Show 'selected'


  2. #2
    davegri's Avatar
    davegri is online now Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,424
    Simply showing values you put in controls doesn't help at all. You're using 3 terms describing your desired result ("Show, Select, Hide").
    Can you describe the problem in terms of what you want to happen and what you have tried so far, showing code method used?

  3. #3
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,122
    I think you need to leave the "placeholder" fields having the Show check-box checked, run the query and in datasheet view right click on each field you want to hide and click on Hide. Now save your query and it should open like that next time.

    Cheers,
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

  4. #4
    black272 is offline Novice
    Windows 10 Access 2007
    Join Date
    Dec 2021
    Posts
    5
    Sorry, I'm somewhat new to access and have little SQL background so I'll do my best to clearly explain my problem. Essentially I dont want to show a column but Access is asking for parameters when I Hide the column.

    More specifically:

    I have a large table that I'm running a query on. Many of the tables data and field names need to be renamed, but they cant be renamed in the table, thus Im making expressions to rename them.

    Renaming the field names seem to be easy enough. Renaming the data has been more difficult. Many of the data requires iif statements for renaming. Im not sure how to create many unique iif statements in one builder/field so I've had to create multiple fields with single iff statements.

    For example field [A] has data x, y, z. The data has to be renamed to a, b, c, where x = a, y = b, z = c. However its not as simple as nested replace function as I mentioned above. Specifically to rename x to a, conditions must be met (for example a data point in a different field must be present). To rename y to b different conditions must be met, etc.

    This has led to me to creating new fields where each condition is treated on its own. Because of this, the final query doesnt need to show many of the fields because theyre just needed to calculate another field. Id like to hide most of these fields in the final query, but as soon as I do, Access ask for parameters.



    Sorry if this doesnt make much sense

  5. #5
    black272 is offline Novice
    Windows 10 Access 2007
    Join Date
    Dec 2021
    Posts
    5
    This was the answer. Thank you!

  6. #6
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,122

    Happy New Year!
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 2
    Last Post: 03-11-2019, 01:26 PM
  2. Replies: 3
    Last Post: 12-09-2017, 01:18 PM
  3. Replies: 10
    Last Post: 08-03-2017, 01:00 PM
  4. Replies: 3
    Last Post: 05-08-2017, 12:44 AM
  5. Replies: 2
    Last Post: 11-20-2012, 03:21 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums