Results 1 to 7 of 7
  1. #1
    angie is offline Competent Performer
    Windows 8 Access 2013
    Join Date
    Dec 2013
    Posts
    232

    VB To not add to field

    Private SubApcoAir_AfterUpdate()
    IfMe.ApcoAir = False Then
    Me.TotalAddOnPrice= Me.TotalAddOnPrice - 850
    Me.FinancedPrice= Me.FinancedPrice - 850
    Me.FinancedPricetwo= Me.FinancedPricetwo - 850
    Me.CashPrice= Me.CashPrice - 850
    Me.CashPricetwo= Me.CashPricetwo - 850
    Me.ProposalDescription= Replace(Me.ProposalDescription, vbCrLf & "INSTALL APCO AIR","")
    Me.ProposalDescriptionTwo= Replace(Me.ProposalDescriptionTwo, vbCrLf & "INSTALL APCO AIR","")
    Else
    Me.TotalAddOnPrice= Me.TotalAddOnPrice + 850
    Me.FinancedPrice= Me.FinancedPrice + 850
    Me.FinancedPricetwo= Me.FinancedPricetwo + 850
    Me.CashPrice= Me.CashPrice + 850
    Me.CashPricetwo= Me.CashPricetwo + 850


    Me.ProposalDescription= Me.ProposalDescription & vbCrLf & "INSTALL APCO AIR"
    Me.ProposalDescriptionTwo= Me.ProposalDescriptionTwo & vbCrLf & "INSTALL APCO AIR"
    End If

    End Sub

    I use theabove and it works great, but I need it not to add to “proposalDescriptionTwo “ if there is nothing in that text box . To make no changes in the “proposalDescriptionTwo “ if there is nothing in it.


    Thank You
    Angie


  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,815
    If Not IsNull(Me.ProposalDescriptionTwo) Then Me.ProposalDescriptionTwo = Replace(Me.ProposalDescriptionTwo, vbCrLf & "INSTALL APCO AIR","")
    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
    angie is offline Competent Performer
    Windows 8 Access 2013
    Join Date
    Dec 2013
    Posts
    232
    Quote Originally Posted by June7 View Post
    If Not IsNull(Me.ProposalDescriptionTwo) Then Me.ProposalDescriptionTwo = Replace(Me.ProposalDescriptionTwo, vbCrLf & "INSTALL APCO AIR","")
    Hi June
    I put the above you gave me where in the code right before else and It did not work not sure if I put it in the right place

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,815
    You replaced your original code?

    You probably want similar statement in the code after Else as well.
    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
    angie is offline Competent Performer
    Windows 8 Access 2013
    Join Date
    Dec 2013
    Posts
    232
    Quote Originally Posted by June7 View Post
    You replaced your original code?

    You probably want similar statement in the code after Else as well.
    I replaced it in line 9, left everything else the same. But it didn’t work.

  6. #6
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,716
    Angie,

    What is latest status?

    Please give full description of what this represents? "But it didn’t work"

  7. #7
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,815
    Error message, wrong result, nothing happens?
    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: 21
    Last Post: 09-29-2017, 01:30 PM
  2. Replies: 6
    Last Post: 06-26-2015, 08:55 PM
  3. Replies: 17
    Last Post: 03-16-2014, 10:52 PM
  4. Replies: 3
    Last Post: 12-27-2013, 02:33 PM
  5. Replies: 1
    Last Post: 03-03-2012, 10:17 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