Results 1 to 5 of 5
  1. #1
    INeedAboutTreeFiddy is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2012
    Posts
    3

    If checkbox is checked, add X to a current value

    Hey guys,


    I've had a bit of a look through and I've been googling this and searching around for a few weeks now, but with no avail. I've been working on a database for school -- a motel database to be specific -- and I've encountered a problem.

    The business that I'm creating this database for has a 'cot' option, which allows for the customer to have a cot in their room at an added fee of $10 to the current room cost.
    Basically, I just need $10 (or just 10) to be added to the "Payment Due" field once the "Cot" checkbox is checked.

    You help would be appreciated so much. I've been looking for so long and I thought something this simple would be a common problem, but evidently not. Thanks in advance for any help you can give.


    Pic related:
    Click image for larger version. 

Name:	cotprice.jpg 
Views:	13 
Size:	40.0 KB 
ID:	7844

  2. #2
    R_Badger is offline Knows a few tricks
    Windows XP Access 2003
    Join Date
    Feb 2012
    Location
    Suffolk, UK
    Posts
    262
    If all you need to do is display the figure change then:

    In the controlsource for the payment due field you could do something along the lines of:

    =iif([cot]=true,[Payment_due]+10,[Payment_due]).

  3. #3
    INeedAboutTreeFiddy is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2012
    Posts
    3
    Thanks for the reply, R Badger. I can see how it should work, but it just doesn't seem to. I have "#Name?" in the field instead of a currency and it doesn't change when clicking the Cot checkbox. I've had this "#Name?" problem before, but I've never really known what to do.

    How it was entered:
    Click image for larger version. 

Name:	controlsource.jpg 
Views:	11 
Size:	22.8 KB 
ID:	7847

    The result:
    Click image for larger version. 

Name:	error.jpg 
Views:	8 
Size:	28.3 KB 
ID:	7848

  4. #4
    R_Badger is offline Knows a few tricks
    Windows XP Access 2003
    Join Date
    Feb 2012
    Location
    Suffolk, UK
    Posts
    262
    Remove the first payment_due from the controlsource it should be =iif(etc)

  5. #5
    INeedAboutTreeFiddy is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2012
    Posts
    3
    I tried removing the Payment_Due that and the result was:
    Click image for larger version. 

Name:	error2.jpg 
Views:	13 
Size:	25.0 KB 
ID:	7853

    I'm not sure why that's not working.

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

Similar Threads

  1. Replies: 8
    Last Post: 03-24-2012, 11:03 AM
  2. Replies: 4
    Last Post: 03-02-2012, 08:41 AM
  3. Replies: 22
    Last Post: 11-14-2011, 10:29 AM
  4. Counting only 'checked' Yes/No fields on a
    By pwdpwd in forum Programming
    Replies: 9
    Last Post: 04-14-2011, 09:28 AM
  5. Simple query to show when items are not checked?
    By mrwistles in forum Queries
    Replies: 28
    Last Post: 09-02-2010, 02:52 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