Results 1 to 2 of 2
  1. #1
    Jessica240 is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    May 2014
    Posts
    95

    Populating a query based on a text box in a form

    Hello all.. This seems like a very simple problem, but I can't seem to figure it out. I'm sure this will be an easy one for you experts!




    I have a table which shows me the price of a list of items. What I need is to be able to change the price of the items by simply entering in a percentage into an expression which will then change all of the prices in that table by that percent.

    Example:

    Product Table:

    PRODUCT.....PRICE
    Hats.......... $20.00

    Scarfs.........$10.00

    Shoes...........$50.00


    So now if I want to find out how much the price would be for all of those items at 90%, I want to be able to type in "90%" into my text box which would produce a table like this:

    PRODUCT.....PRICE
    Hats.......... $18.00

    Scarfs..........$9.00

    Shoes..........$45.00


    For the field [PRICE] I would have an expression that would be: [PRICE]*[TEXTBOX] where the text box is whatever value the percent would be...


    I tried just using a parameter which works for updating the price by percent. But I need to use the results of the table for other queries which then will be used in a report to calculate some other information. When I run my report which is based off of queries that is based off this table, I get a pop-up window that says "The Microsoft Access database engine does not recognize '[ENTER PERCENT]' as a valid field name or expression."


    Meaning that it won't let me use the parameter box.

    Does anyone have any suggestions?

  2. #2
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    Perhaps a Dynamic Parameterized Query is the solution. You can create an alias in your query by adding a field with something like this

    MyNewAmount: [TableName].[PRICE] * [Forms]![FormName].[TEXTBOX]

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

Similar Threads

  1. Replies: 9
    Last Post: 06-02-2014, 08:10 AM
  2. query column not populating text box.
    By mejia.j88 in forum Queries
    Replies: 2
    Last Post: 02-23-2012, 02:48 PM
  3. Populating attachment field based on text box
    By justinwright in forum Forms
    Replies: 16
    Last Post: 09-22-2010, 08:38 AM
  4. Replies: 15
    Last Post: 09-18-2010, 01:19 PM
  5. Replies: 3
    Last Post: 06-29-2010, 12:08 PM

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