Page 2 of 2 FirstFirst 12
Results 16 to 19 of 19
  1. #16
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 8 Access 2013
    Join Date
    Aug 2013
    Posts
    7,862
    As you mentioned, you are just now beginning to learn about Access. The simple answer how to fix this is to learn more about Access. It may seem blunt, but that is the truth. In this case, you are tackling something that is not very advanced, but you do need to understand several things. You are on the right track by identifying the column name in the table you wish to use. But, you are still far from resolving the issue.



    Basically, I already told you how to fix it. Is there something else you can work on that would help you to learn about Access? Your time would be better served if you dedicated some of your time to learning and not customizing an existing database.

  2. #17
    tpenland is offline Novice
    Windows 8 Access 2016
    Join Date
    Sep 2016
    Posts
    9
    ..........

  3. #18
    tpenland is offline Novice
    Windows 8 Access 2016
    Join Date
    Sep 2016
    Posts
    9
    Thanks for the reply. I truly wish I could give this up but it's what I've been tasked with. Thanks.

  4. #19
    ssanfu is offline Master of Nothing
    Windows XP Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    First, go through ALL of your code and delete every ".Text". That is the wrong property to use. The property you want is ".Value", but since that property is the default, you don't need to type it.

    EVERY code module should have these two lines at the top:
    Code:
    Option Compare Database
    Option Explicit
    To refer to a form, this is incorrect
    Code:
        [Form_REDEMPTION INPUT].frmPartialPay.Requery
    The correct syntax is
    Code:
        Forms![REDEMPTION INPUT].frmPartialPay.Requery
    I modified your code to add the company to the table
    Code:
    Private Sub CreatePayments()
        On Error GoTo ErrorHandler
    
        Dim d As DAO.Database
        Dim i As Integer
        Dim totnum As Integer
        Dim Amnt2Ellis As Currency
        Dim AmntFull As Currency
        Dim AmntPerc As Double
        Dim AmntDate As Date
        Dim PropID As Integer
        Dim strSQL As String
    
        Set d = CurrentDb
    
        DoCmd.SetWarnings False
        If Me.txtDownPayment > 0 Then
            DoCmd.OpenQuery "qryUpdateDownPayment"
        End If
    
        If Me.txtFees > 0 Then
            DoCmd.OpenQuery "qryUpdateFees"
        End If
        DoCmd.SetWarnings True
    
        totnum = Me.txtNumberPayments
        AmntFull = Me.txtMonthlyPayments
        Amnt2Ellis = AmntFull * Me.txtMPPerc
        AmntPerc = Me.txtMPPerc
        AmntDate = Format(Me.txtFirstPaymentDate, "Short Date")
        PropID = Forms![REDEMPTION INPUT].PropertyID
    
    
        For i = 1 To totnum
            If i = 1 Then
                strSQL = "INSERT INTO tblPartialPay ( PaymentDueDate, AmntDue, FullPaid, LoanID, Company )"
                strSQL = strSQL & " VALUES (#" & AmntDate & "# " & ", " & Amnt2Ellis & ", " & AmntFull & ", " & PropID & ", '" & Me.txtCompany & "');"
                '            Debug.Print strSQL
                d.Execute strSQL, dbFailOnError
            Else
                strSQL = "INSERT INTO tblPartialPay ( PaymentDueDate, AmntDue, FullPaid, LoanID, Company )"
                strSQL = strSQL & " VALUES (#" & DateAdd("M", i - 1, AmntDate) & "# " & ", " & Amnt2Ellis & ", " & AmntFull & ", " & PropID & ", '" & Me.txtCompany & "');"
                '            Debug.Print strSQL
                d.Execute strSQL, dbFailOnError
            End If
        Next i
    
    ExitSub:
        Set d = Nothing
        Forms![REDEMPTION INPUT].frmPartialPay.Requery
        Exit Sub
    
    ErrorHandler:
        MsgBox Err.Number & " " & Err.Description
        Resume ExitSub
    
    End Sub
    I hope you understand the code........

Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 9
    Last Post: 07-06-2015, 01:47 AM
  2. Replies: 2
    Last Post: 10-31-2012, 11:52 AM
  3. Replies: 2
    Last Post: 06-14-2010, 03:25 PM
  4. query problem i have a problem wi
    By maxx3 in forum Queries
    Replies: 0
    Last Post: 06-29-2009, 02: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