O
Opal
I'm lost with this one. I have a form that opens with the
results of a select query between two tables. Actually
a sub-query - but that is not the problem, that works
fine. The object of the form is for the user to select
records from the query that need to be elevated to another
team of users to take action on. The form was working,
but now I am getting the above error message when
I select the "Submit" button on the form. Here is the
code:
Private Sub SubmitCMRequest_Click()
If Len([EntryDatetxt] & "") = 0 Then
MsgBox "You must select a Date."
Exit Sub
End If
If Me.Dirty Then
Me.Dirty = False
Exit Sub
End If
SubmitConcern2
End Sub
Sub SubmitConcern2()
On Error GoTo Err_Submit_Click
Dim dbobject As DAO.Database
Dim ConcernRS As DAO.Recordset
Dim strquery As String
Set dbobject = CurrentDb
strquery = "SELECT * FROM ConcernComparetbl;"
Set ConcernRS = dbobject.OpenRecordset(strquery)
ConcernRS.AddNew
ConcernRS!IDNumber = Forms![ConcernCompareqryfrm]!IDNumber.Value
ConcernRS!EntryDate = Forms![ConcernCompareqryfrm]!EntryDatetxt.Value
ConcernRS!Status = Forms![ConcernCompareqryfrm]!Status.Value
ConcernRS!Panel = Forms![ConcernCompareqryfrm]!AShifttbl_Panel.Value
ConcernRS!Concern = Forms![ConcernCompareqryfrm]!
AShifttbl_Concern.Value
ConcernRS!AShifttbl_Rank = Forms![ConcernCompareqryfrm]!
AShifttbl_Rank.Value
ConcernRS!AShifttbl_IDNumber = Forms![ConcernCompareqryfrm]!
AShifttbl_IDNumber.Value
ConcernRS!AShifttbl_Comments = Forms![ConcernCompareqryfrm]!
AShifttbl_Comments.Value
ConcernRS!BShifttbl_Rank = Forms![ConcernCompareqryfrm]!
BShifttbl_Rank.Value
ConcernRS!BShifttbl_IDNumber = Forms![ConcernCompareqryfrm]!
BShifttbl_IDNumber.Value
ConcernRS!BShifttbl_Comments = Forms![ConcernCompareqryfrm]!
BShifttbl_Comments.Value
ConcernRS.Update
Exit_Submit_Click:
Exit Sub
Err_Submit_Click:
MsgBox Err.Description
Resume Exit_Submit_Click
End Sub
When I tab through the code, it jumps from
ConcenRS. AddNew
Right to:
MsgBox Err.Description
But I can't figure out why it does this. Can anyone help?
results of a select query between two tables. Actually
a sub-query - but that is not the problem, that works
fine. The object of the form is for the user to select
records from the query that need to be elevated to another
team of users to take action on. The form was working,
but now I am getting the above error message when
I select the "Submit" button on the form. Here is the
code:
Private Sub SubmitCMRequest_Click()
If Len([EntryDatetxt] & "") = 0 Then
MsgBox "You must select a Date."
Exit Sub
End If
If Me.Dirty Then
Me.Dirty = False
Exit Sub
End If
SubmitConcern2
End Sub
Sub SubmitConcern2()
On Error GoTo Err_Submit_Click
Dim dbobject As DAO.Database
Dim ConcernRS As DAO.Recordset
Dim strquery As String
Set dbobject = CurrentDb
strquery = "SELECT * FROM ConcernComparetbl;"
Set ConcernRS = dbobject.OpenRecordset(strquery)
ConcernRS.AddNew
ConcernRS!IDNumber = Forms![ConcernCompareqryfrm]!IDNumber.Value
ConcernRS!EntryDate = Forms![ConcernCompareqryfrm]!EntryDatetxt.Value
ConcernRS!Status = Forms![ConcernCompareqryfrm]!Status.Value
ConcernRS!Panel = Forms![ConcernCompareqryfrm]!AShifttbl_Panel.Value
ConcernRS!Concern = Forms![ConcernCompareqryfrm]!
AShifttbl_Concern.Value
ConcernRS!AShifttbl_Rank = Forms![ConcernCompareqryfrm]!
AShifttbl_Rank.Value
ConcernRS!AShifttbl_IDNumber = Forms![ConcernCompareqryfrm]!
AShifttbl_IDNumber.Value
ConcernRS!AShifttbl_Comments = Forms![ConcernCompareqryfrm]!
AShifttbl_Comments.Value
ConcernRS!BShifttbl_Rank = Forms![ConcernCompareqryfrm]!
BShifttbl_Rank.Value
ConcernRS!BShifttbl_IDNumber = Forms![ConcernCompareqryfrm]!
BShifttbl_IDNumber.Value
ConcernRS!BShifttbl_Comments = Forms![ConcernCompareqryfrm]!
BShifttbl_Comments.Value
ConcernRS.Update
Exit_Submit_Click:
Exit Sub
Err_Submit_Click:
MsgBox Err.Description
Resume Exit_Submit_Click
End Sub
When I tab through the code, it jumps from
ConcenRS. AddNew
Right to:
MsgBox Err.Description
But I can't figure out why it does this. Can anyone help?