Results 1 to 3 of 3
  1. #1
    jbaughman is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2013
    Posts
    5

    Question If check box is checked double the amount entered into table


    I am working on a database that tracks printing press production and waste.

    To calculate for duplex printing, I want to include a check box on the form that when the box is checked it will double the job page amount entered into the table and on the total shown at the bottom of the form.

    This is probably pretty easy, but for some reason, I can't wrap my head around the logic or coding needed.

    Any help will be much appreciated.

    Thanks,
    Jeff

  2. #2
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,016
    You don't say where you're plainning to do this, which could effect the exact syntax, but generally speaking this should do it, replacing the Field names below with your actual names, of course:

    = IIf([CheckBoxName] = -1, [JobPageAmt] * 2, [JobPageAmt])

    Linq ;0)>
    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  3. #3
    jbaughman is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2013
    Posts
    5
    Thanks linq!

    I opted to go a different route with a msgbox and checking and unchecking logic. I had help (MajP), but here is the code that was used, in case it is needed in the future:

    Private Sub isDuplex_BeforeUpdate(Cancel As Integer)
    If Trim(Me.JobPages & " ") = "" Then
    'Need to have the job page amount filled in
    MsgBox "Must fill in the job page amount first"
    Cancel = True
    Else
    'Handle checking
    If isDuplex Then
    Me.JobPages = 2 * Me.JobPages
    'Handle unchecking
    Else
    Me.JobPages = 0.5 * Me.JobPages
    End If
    End If

    End Sub


    Thanks again for the suggestion!!

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

Similar Threads

  1. Query to check for a CERTAIN amount of rows
    By taimysho0 in forum Programming
    Replies: 8
    Last Post: 05-30-2012, 10:48 PM
  2. Replies: 8
    Last Post: 03-24-2012, 11:03 AM
  3. Replies: 22
    Last Post: 11-14-2011, 10:29 AM
  4. OpenReport Command with Double Check Where Statement
    By Robert M in forum Programming
    Replies: 3
    Last Post: 09-17-2009, 04:01 PM
  5. Code to spell out check amount?
    By spkoest in forum Access
    Replies: 4
    Last Post: 06-16-2009, 07:44 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