Hi I need some help
I am using Mysql and Access to create db Project. I used MYODBC to connect with access. Everything seems to be working. Everyday When I open my Database the machine has to update some. I wrote the code in VBA. The code seems to be okay but it giving me error that it can't update the database. So can you help me to finish my project.
here is my source code
Dim mintCurrentNextpaymentmonth As Integer
Dim mintCurrentDatemonth As Integer
Dim mintnextNextPaymentmonth As Integer
Dim mintCurrentNextPaymentYear As Integer
Dim mintCurrentyear As Integer
Dim mintCalculatemonth As Integer
Dim mintcurrentNextPaymentday As Integer
Dim strdate As String
Dim second_mintnextNextPaymentmonth As Integer
Dim second_mintNextyear As Integer
' Modify this line to include the path to Northwind
' on your computer.
' Change values in the ReportsTo field to 5 for all
' employee records that currently have ReportsTo
' values of 2.
Me.Recordset.MoveFirst
Do Until Me.Recordset.EOF
mintCurrentNextpaymentmonth = Format(Me.NextPaymentDate, "mm"
mintCurrentDatemonth = Format(Now(), "mm" '
mintcurrentNextPaymentday = Format(Me.NextPaymentDate, "dd"
mintCurrentNextPaymentYear = Format(Me.NextPaymentDate, "yy"
mintCurrentyear = Format(Now(), "yy"
If Now() > Me.NextPaymentDate Then
second_mintnextNextPaymentmonth = mintCurrentNextpaymentmonth + Me.BillingTerm
If second_mintnextNextPaymentmonth >= 12 Then
second_mintnextNextPaymentmonth = second_mintnextNextPaymentmonth - 12
second_mintNextyear = mintCurrentNextPaymentYear + 1
strdate = Str(second_mintnextNextPaymentmonth) + Str(mintcurrentNextPaymentday) + Str(second_mintNextyear)
Me.NextPaymentDate.Value = Format(strdate, "mm/dd/yy"
Else
strdate = Str(mintCurrentNextpaymentmonth) + Str(mintcurrentNextPaymentday) + Str(mintCurrentNextPaymentYear)
Me.NextPaymentDate.Value = Format(strdate, "mm/dd/yy"
End If
Me.Requery
End If
Me.Recordset.MoveNext
Loop
End Sub
I need to submit my project this week
I am using Mysql and Access to create db Project. I used MYODBC to connect with access. Everything seems to be working. Everyday When I open my Database the machine has to update some. I wrote the code in VBA. The code seems to be okay but it giving me error that it can't update the database. So can you help me to finish my project.
here is my source code
Dim mintCurrentNextpaymentmonth As Integer
Dim mintCurrentDatemonth As Integer
Dim mintnextNextPaymentmonth As Integer
Dim mintCurrentNextPaymentYear As Integer
Dim mintCurrentyear As Integer
Dim mintCalculatemonth As Integer
Dim mintcurrentNextPaymentday As Integer
Dim strdate As String
Dim second_mintnextNextPaymentmonth As Integer
Dim second_mintNextyear As Integer
' Modify this line to include the path to Northwind
' on your computer.
' Change values in the ReportsTo field to 5 for all
' employee records that currently have ReportsTo
' values of 2.
Me.Recordset.MoveFirst
Do Until Me.Recordset.EOF
mintCurrentNextpaymentmonth = Format(Me.NextPaymentDate, "mm"
mintCurrentDatemonth = Format(Now(), "mm" '
mintcurrentNextPaymentday = Format(Me.NextPaymentDate, "dd"
mintCurrentNextPaymentYear = Format(Me.NextPaymentDate, "yy"
mintCurrentyear = Format(Now(), "yy"
If Now() > Me.NextPaymentDate Then
second_mintnextNextPaymentmonth = mintCurrentNextpaymentmonth + Me.BillingTerm
If second_mintnextNextPaymentmonth >= 12 Then
second_mintnextNextPaymentmonth = second_mintnextNextPaymentmonth - 12
second_mintNextyear = mintCurrentNextPaymentYear + 1
strdate = Str(second_mintnextNextPaymentmonth) + Str(mintcurrentNextPaymentday) + Str(second_mintNextyear)
Me.NextPaymentDate.Value = Format(strdate, "mm/dd/yy"
Else
strdate = Str(mintCurrentNextpaymentmonth) + Str(mintcurrentNextPaymentday) + Str(mintCurrentNextPaymentYear)
Me.NextPaymentDate.Value = Format(strdate, "mm/dd/yy"
End If
Me.Requery
End If
Me.Recordset.MoveNext
Loop
End Sub
I need to submit my project this week