Results 1 to 8 of 8
  1. #1
    BillieH is offline Novice
    Windows Vista Access 2010 32bit
    Join Date
    Mar 2014
    Posts
    4

    Unhappy Why can't I use Expression Builder in tables?

    I feel like a fool.... I have finally got my head around using expression builder....
    So I built an expression from a form. Now that works, but I cannot get it to work from tables, so it is automatic....

    In my invoice table I have allowed for 10 items
    Each has a quantity and price, therefore * the two to get the item amount.... but I did this in a form....
    why can't i do it in the table in the first place?
    At the end I want to add all ten item amounts....


    works a treat in forms, but when I try to generate reports from this all the expressions disappear....
    As I said I am a beginner, only been doing this for three yrs and NEVER with expressions....

    Ideally I would like to build the expressions before I build forms or queries or reports....
    I feel embarrassed that I am missing something fundamental in my understanding....
    Please Help...
    I dont' even know if I have expressed my issue clearly enough...

  2. #2
    Ruegen's Avatar
    Ruegen is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2013
    Location
    Australia
    Posts
    1,496
    Quote Originally Posted by BillieH View Post
    I feel like a fool.... I have finally got my head around using expression builder....
    So I built an expression from a form. Now that works, but I cannot get it to work from tables, so it is automatic....

    In my invoice table I have allowed for 10 items
    Each has a quantity and price, therefore * the two to get the item amount.... but I did this in a form....
    why can't i do it in the table in the first place?
    At the end I want to add all ten item amounts....
    works a treat in forms, but when I try to generate reports from this all the expressions disappear....
    As I said I am a beginner, only been doing this for three yrs and NEVER with expressions....

    Ideally I would like to build the expressions before I build forms or queries or reports....
    I feel embarrassed that I am missing something fundamental in my understanding....
    Please Help...
    I dont' even know if I have expressed my issue clearly enough...
    Tables generally are for holding/storing values. You can make a query that has an expression that either concatenates values, calculates values or copies values (and then you can put those into a table field in turn)

    update
    in a query you can make a field expression (expr1: or whatever name you like then price * qty )

    I do my tables with standard values. Then I make a query with everything I want to see on a form (to as much as I can) then make that the record source for the form.

  3. #3
    Ruegen's Avatar
    Ruegen is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2013
    Location
    Australia
    Posts
    1,496
    Also I would be doing invoices for records> so a table for invoices. This way any invoice that has a field value holding the same value as the customer ID only shows in the customers list of invoices

    This way you can add many invoices to the customer and show it in a listbox.

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,644
    You have 10 fields for product items? This is not a normalized data structure and will probably cause you issues down the road.

    I haven't used calculated fields in table so just did some testing. The expression builder opens when the calculated field is first created. It can later be invoked by clicking the ellipsis (...). The calculated fields are available to the report. All works for me.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    BillieH is offline Novice
    Windows Vista Access 2010 32bit
    Join Date
    Mar 2014
    Posts
    4
    Thank you... that is about the only part I got right! Same with suppliers and expenses

  6. #6
    BillieH is offline Novice
    Windows Vista Access 2010 32bit
    Join Date
    Mar 2014
    Posts
    4
    Okay, that makes a lot of sense.... wasn't such a silly problem afterall!

    So should I remove the current expressions in the forms and re-start with queries.... do I do a query for each item or do all 10 and the total in one query?

    I am in Clunes, Vic
    Thank you Ruegen

  7. #7
    BillieH is offline Novice
    Windows Vista Access 2010 32bit
    Join Date
    Mar 2014
    Posts
    4
    Dear Ruegen,
    Do I do one expression per query or do I all expressions in one query

  8. #8
    Ruegen's Avatar
    Ruegen is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2013
    Location
    Australia
    Posts
    1,496
    The idea is the raw values like say price, name, address, quantity are stored in the table. You wouldn't do calculations in a table because you don't want to store calculations in case those calculations happen to be wrong. You don't want to store a value if it is wrong (and that can happen form time to time).

    When you make a query you are "selecting" something from the table, like a column. You can choose what you want to select. Say you select the name of the product, the quantity sold (which might be in another table and you like them together in the query) and you the price you sold them for. In the query builder you create a query, add a new field then right click in that blank field. It's like adding another column but it won't store any value in the table. Now with this new field you can "concatenate" (put things together into one long thing)

    Concatenate can be something simple Total: price * quantity

    or something complicated

    or just some words (strings i.e. whatever is in " ")

    say you want to concatenate the persons first name (which is a string) and surname (another string) into one thing - FullName: firstName & " " & Surname

    I added a little & " " to give a space between the two

    you have to add an & to add the next string

    When you now go to look at the query after - you will see price, quantity and the total and the sums below it for every record/row or the name as one full name.

    Now when you make a form you have totals and can display that on your form. You can also use it for reports if you use the same query.

    Make sense?

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

Similar Threads

  1. Replies: 2
    Last Post: 11-20-2012, 03:21 AM
  2. Expression builder help
    By jigg14 in forum Forms
    Replies: 1
    Last Post: 03-19-2012, 09:47 AM
  3. expression builder
    By tonyl in forum Access
    Replies: 3
    Last Post: 11-26-2011, 12:00 AM
  4. Expression builder
    By PJ_d_DJ in forum Access
    Replies: 2
    Last Post: 02-24-2011, 03:38 AM
  5. Expression Builder
    By mistaken_myst in forum Access
    Replies: 2
    Last Post: 05-07-2008, 01:30 PM

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