Results 1 to 6 of 6
  1. #1
    keithb is offline Novice
    Windows 8 Access 2013
    Join Date
    Jan 2015
    Posts
    3

    Criteria to show checkbox value

    Hello all,

    I have just started learning Access and have got so far and now need information or help for the following.
    I have a very basic database with 2 tbls and looking to create a qry which will return only the selected data.
    I have 3 checkboxes relating to 3 prices. If 1st check box is selected it shows the price for that check box in a history form.
    Can this be calculated in the criteria field to show the records for that Company.
    (or is there an easier way of doing this that I haven't looked at)



    Thanks in advance.
    Attached Files Attached Files

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    How are these tables related? Is the ID field in tblQuotes the foreign key for CustomerID?

    Not really clear on what you are asking for. The history form shows all 3 prices. Exactly what filter criteria do you want - all quotes for a particular metal code?

    It is currently possible to select all 3 checkboxes. Is that what you want to allow?If a quote can be only one type (Gold,Silver,Bronze) then should not be 3 check fields, should be one field with 3 options. Use a combobox or radio buttons in option group. With radio buttons, easiest is to save number value (1,2,3) as codes for Gold,Silver,Bronze.

    Then options for an expression in textbox or query:

    If saving 1,2,3:
    Choose([Metal], [GoldPrice], [SilverPrice], [BronzePrice])

    If saving "Gold", "Silver", "Bronze":
    Switch([Metal]="Gold",[GoldPrice], [Metal]="Silver",[SilverPrice], [Metal]="Bronze",[BronzePrice])

    If you keep the 3 check fields, the calc will be nested IIf(). Also, filtering records will be more complicated.
    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.

  3. #3
    keithb is offline Novice
    Windows 8 Access 2013
    Join Date
    Jan 2015
    Posts
    3
    Hello June7,
    Thanks for taking the time to look at my query.
    I have altered it to radio option group not sure if I understand you right.
    What i am trying to do is: On the frmHistory data sheet
    is to see company a quote number 10 to show that they selected the brone price
    and not see the silver or gold price values.
    the same for quote 11 and 12.
    I am not sure what criteria I need to insert into the qryOrderHistory
    to show what I am wanting to see.(if it can be done at all).
    Database1.zip

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    The History form is set for DataEntry Yes - this means it will not display existing records, only allow entry of new records.

    Why have two forms? One form can serve to display and search for existing records as well as allow new record entry.
    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
    keithb is offline Novice
    Windows 8 Access 2013
    Join Date
    Jan 2015
    Posts
    3
    As I have just started learning Access (beginner),
    I am not aware that the History form is set for data entry, I thought I had created the form to view the history.
    As to why have 2 forms I have just started to learn and am not aware that one form can do data entry as well as viewing history.
    Any help or advice would be appreciated.

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    What exactly do you need to know?

    Use 1 form and apply filter criteria to find and view existing data. Move to new record row to enter new record. All can be done with intrinsic Access functionality found on the ribbon and right click shortcut menu. Other methods require programming.

    Have you completed a tutorial book?
    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.

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

Similar Threads

  1. Replies: 1
    Last Post: 11-26-2014, 02:30 PM
  2. Replies: 3
    Last Post: 01-14-2014, 04:17 PM
  3. Replies: 1
    Last Post: 06-24-2013, 07:50 AM
  4. Replies: 1
    Last Post: 06-12-2011, 07:08 AM
  5. using checkbox as iif criteria
    By TheShabz in forum Queries
    Replies: 3
    Last Post: 01-18-2011, 05:10 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