Results 1 to 6 of 6
  1. #1
    burrina's Avatar
    burrina is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2012
    Location
    Freeport,Texas
    Posts
    1,383

    Not Allow Credit and Debit, One or the Other

    How can I make sure the user can't choose both, if they do then what action to take? I am thinking to not allow the credit by default with msgbox


    Will the below work, is there are a better way?

    If Not IsNull([FrequencyAmnt]) And ([credit]) Then 'Purpose: Debit or Credit, Not Both.
    MsgBox "Debit or Credit, Both Are Not Allowed"
    Me.credit.SetFocus
    credit = ""
    Exit Sub
    End If

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    Maybe:

    If Not IsNull([debit]) And Not IsNull([credit]) Then 'Purpose: Debit or Credit, Not Both.
    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
    burrina's Avatar
    burrina is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2012
    Location
    Freeport,Texas
    Posts
    1,383
    Yep, I left one out! I hate it when that happens. I am making progress as blazing speeds here! Too bad the blazing speeds is at a snails pace...

    Almost in Beta Mode...

  4. #4
    burrina's Avatar
    burrina is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2012
    Location
    Freeport,Texas
    Posts
    1,383
    If Not IsNull([debit]) And IsNull([credit]) Or IsNull([debit]) And Not IsNull([credit]) Then 'Purpose: Debit or Credit, Not Both.
    MsgBox "Debit or Credit, Both Are Not Allowed"
    Me.Undo
    If Me.Dirty Then Me.Dirty = False
    Me.debit.SetFocus
    credit = ""
    Exit Sub
    End If


    I get a message about both are not allowed but I dont have both?

    Here is the key, they both have a default value of zero and so they show $0.00
    I need to make an adjustment that will allow for a zero value.

  5. #5
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    If Nz([debit],0) <> 0 And Nz([credit],0) <> 0 Then
    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.

  6. #6
    burrina's Avatar
    burrina is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2012
    Location
    Freeport,Texas
    Posts
    1,383
    Spot on as usual, Krap! I knew that too. Sometimes I sits and thinks and sometimes I just sits!

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

Similar Threads

  1. Replies: 3
    Last Post: 11-19-2012, 05:05 PM
  2. Replies: 10
    Last Post: 08-25-2012, 03:25 PM
  3. running sum for debit-credit in subform
    By roshanzarmal in forum Queries
    Replies: 1
    Last Post: 09-29-2011, 09:37 PM
  4. Replies: 2
    Last Post: 08-24-2011, 12:59 PM
  5. Credit Card Info, Where?
    By mastromb in forum Access
    Replies: 3
    Last Post: 05-26-2010, 12:37 AM

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