Results 1 to 4 of 4
  1. #1
    Tuckejam is offline Competent Performer
    Windows 10 Access 2010 64bit
    Join Date
    Jan 2020
    Posts
    171

    If ComBox = "Debit" Then Value Entered is Automatically Negative

    I have a form for entering Transactions into an account ledger.

    so when I select Transaction Type "Debit" from the Combobox I would like the value entered in the Amount field to automatically be a negative value


    Thank you

  2. #2
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 10 Access 2016
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,614
    Try:
    If combox = "Debit" Then
    AmountField = -1 * AmountField
    End If
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  3. #3
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,933
    or just

    If combox = "Debit" Then
    AmountField = -AmountField
    End If

    or just leave it as a positive and apply the negative as and when required


  4. #4
    Join Date
    Apr 2017
    Posts
    1,792
    Have combo's (e.g. cbbTransactionType) RowSource = '1;"debet";-1;"credit"', LinkedColumn = 1, ColumnCount =2, ColumnWidths = "0,2.5" and BoundColumn = 1. Then
    Code:
    ...
    Me.txtAmountField = ABS(Me.txtAmountField)*Me.cbbTransactionType
    ...

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

Similar Threads

  1. Simple table relationships ("faces" to "spaces" to "chairs")
    By skydivetom in forum Database Design
    Replies: 36
    Last Post: 07-20-2019, 01:49 PM
  2. Replies: 1
    Last Post: 09-07-2015, 08:00 AM
  3. Replies: 5
    Last Post: 11-23-2014, 03:54 PM
  4. Replies: 3
    Last Post: 06-29-2012, 08:54 AM
  5. Replies: 13
    Last Post: 12-05-2011, 05:10 AM

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