I am trying to archive data. sending a single record to another table. I get the msg box but as soon as I hit yes, it gives me this error "Object doesn't support this property or method". it was giving me a type mismatch error, but after researching this site I fixed it by reprioritizing the DAO reference. here is the code that I am working with. I cannot find the object that this error is talking about. please help. thanks in advance.
If IsNull(Me.OC_Combo) Then
Beep
MsgBox "Please assign this order to an OC agent prior to archiving."
Else:
Dim holder As String
Dim db As DAO.Database
Dim rs As DAO.Recordset
Set db = CurrentDb()
Set rs = db.OpenRecordset("Archive" ' Change name appropriately
holder = MsgBox("Are You Sure You Want To Archive?", vbYesNo)
If vbYes Then
Me.ArcDate = Now()
Me.Archive = True
With rs
.AddNew
' Here is where you would specify what fields you want to add to your second table.
![ID] = Me.ID
![OrderStatus] = Me.OrderStatus
![Case ID] = Me.Case_ID
![Site Name] = Me.Site_Name
![PimsCaseID] = Me.PimsCaseID
![ProductID] = Me.ProductID
![Region] = Me.Region
![Market] = Me.Market
![OrderDate] = Me.OrderDate
![StatusDate] = Me.StatusDate
![Notes] = Me.Notes
![TestTurnUp] = Me.TestTurnUp
![ReasonCode] = Me.ReasonCode
![OC] = Me.OC_Combo
![calday] = Me.calday
![busday] = Me.busday
![OBusDay] = Me.OAB
![OCalDay] = Me.OAC
![ABusDay] = Me.ASAB
![ACalDay] = Me.ASAC
![AdjStatusDate] = Me.StatusDate
![ArcDate] = Me.ArcDate
.Update
.Close
End With
Else
End If
db.Close
DoCmd.SetWarnings False
'Delete the current record
DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 6, , acMenuVer70
End If
Me.Notes.Enabled = False
If IsNull(Me.OC_Combo) Then
Beep
MsgBox "Please assign this order to an OC agent prior to archiving."
Else:
Dim holder As String
Dim db As DAO.Database
Dim rs As DAO.Recordset
Set db = CurrentDb()
Set rs = db.OpenRecordset("Archive" ' Change name appropriately
holder = MsgBox("Are You Sure You Want To Archive?", vbYesNo)
If vbYes Then
Me.ArcDate = Now()
Me.Archive = True
With rs
.AddNew
' Here is where you would specify what fields you want to add to your second table.
![ID] = Me.ID
![OrderStatus] = Me.OrderStatus
![Case ID] = Me.Case_ID
![Site Name] = Me.Site_Name
![PimsCaseID] = Me.PimsCaseID
![ProductID] = Me.ProductID
![Region] = Me.Region
![Market] = Me.Market
![OrderDate] = Me.OrderDate
![StatusDate] = Me.StatusDate
![Notes] = Me.Notes
![TestTurnUp] = Me.TestTurnUp
![ReasonCode] = Me.ReasonCode
![OC] = Me.OC_Combo
![calday] = Me.calday
![busday] = Me.busday
![OBusDay] = Me.OAB
![OCalDay] = Me.OAC
![ABusDay] = Me.ASAB
![ACalDay] = Me.ASAC
![AdjStatusDate] = Me.StatusDate
![ArcDate] = Me.ArcDate
.Update
.Close
End With
Else
End If
db.Close
DoCmd.SetWarnings False
'Delete the current record
DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 6, , acMenuVer70
End If
Me.Notes.Enabled = False