I am trying to update two tables from the code of a form. When the button is clicked I would like the information to be copied to these tables. Here is the code I have so far. Can anyone make some suggestions as to why I am still getting errors?
Code:
Option Compare Database
Option Explicit
Private Sub Calculate_Click()
On Error GoTo Err_Calculate_Click
Dim varANS As Boolean
Dim dbsBlowMold As Database
Dim rstProductionReporting As Recordset
Dim rstProductionRecords As Recordset
DoCmd.RunMacro "Open Subtotals"
Set dbsBlowMold = OpenDatabase("C:\Melissa\Blowmold.mdb")
Set rstProductionRecords = dbsBlowMold.OpenRecordset("Production Records")
Set rstProductionReporting = dbsBlowMold.OpenRecordset("Production Reporting Table")
Do Until rstProductionReporting.[EOF]
If rstProductionRecords.Material= Me.Material And rstProductionRecords.Mvt = Me.Mvt And rstProductionRecords.post_date = Me.[Post date] And rstProductionRecords.Quantity = Me.Quantity Then
varANS = Msgbox("This action will creat duplicate records.@Continue?", vbYesNo, varANS = True)
If varANS = True Then
With rstProductionRecords
.AddNew
.Mvt = Me.Mvt
.Material = Me.Material
.Old_Matl = Me.[Old matl]
.Material_desc = Me.[Material desc]
.post_date = Me.[Post date]
.Quantity = Me.Quantity
.Update
End With
End If
Else
With rstProductionRecords
.AddNew
.Mvt = Me.Mvt
.Material = Me.Material
.Old_Matl = Me.[Old matl]
.Material_desc = Me.[Material desc]
.post_date = Me.[Post date]
.Quantity = Me.Quantity
.Update
End With
End If
Exit_Calculate_Click:
Exit Sub
Err_Calculate_Click:
Msgbox Err.Description
Resume Exit_Calculate_Click
Loop
End Sub
[\code]
The error message says: "Method or Mode not found."
Any suggestions??