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

    If code to auto fill

    I would like to add “credit” to the second line with the “financed”I tried “financed” or “credit” but it did not work..


    Private Sub Payment_Type_AfterUpdate()
    If Me.Payment_Type = "financed" Then
    Me.Projected_Cost = Nz(Me.Financed_Price, 0)
    Else
    Me.Projected_Cost = Nz(Me.Cash_Price, 0)
    End If
    End Sub

  2. #2
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,974
    Quote Originally Posted by angie View Post
    I would like to add “credit” to the second line with the “financed”I tried “financed” or “credit” but it did not work..
    Code:
    
    Private Sub Payment_Type_AfterUpdate()
    If Me.Payment_Type = "financed" Or Me.Payment_Type ="credit" Then
    Me.Projected_Cost = Nz(Me.Financed_Price, 0)
    Else
    Me.Projected_Cost = Nz(Me.Cash_Price, 0)
    End If
    End Sub
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

  3. #3
    angie is offline Competent Performer
    Windows 8 Access 2013
    Join Date
    Dec 2013
    Posts
    232
    Quote Originally Posted by ridders52 View Post
    Code:
    
    Private Sub Payment_Type_AfterUpdate()
    If Me.Payment_Type = "financed" Or Me.Payment_Type ="credit" Then
    Me.Projected_Cost = Nz(Me.Financed_Price, 0)
    Else
    Me.Projected_Cost = Nz(Me.Cash_Price, 0)
    End If
    End Sub
    this works great thank you so much.

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

Similar Threads

  1. Auto fill help
    By Ternick in forum Access
    Replies: 5
    Last Post: 11-12-2015, 07:21 AM
  2. auto-fill help
    By stephenchan433 in forum Forms
    Replies: 3
    Last Post: 11-09-2015, 08:09 AM
  3. Auto-fill
    By sidewayzalex in forum Database Design
    Replies: 49
    Last Post: 09-14-2011, 11:12 AM
  4. can't auto fill
    By chrisrach3 in forum Access
    Replies: 7
    Last Post: 09-12-2011, 04:41 AM
  5. Auto-Fill
    By sophiecormier in forum Programming
    Replies: 3
    Last Post: 10-02-2010, 08:29 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