G
Guest
I've placed a command button on a continuous form to open up a form in which
to add a Note to the current project. I'm trying to initialize the record
with the StaffID, ProjectNumber, and Status, but I'm receiving the error
message 2448: "You can't assign a value to this object." I've
double-checked the form and control names--I don't think there are any typos.
Can anyone explain it?
Sprinks
' Command button code
Private Sub cmdNote_Click()
On Error GoTo Err_Handler
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "ProjectNotes"
DoCmd.OpenForm stDocName, , , stLinkCriteria, acFormAdd
Err_Exit:
Exit Sub
Err_Handler:
MsgBox "The following error has occurred. Please contact the system
administrator." & _
vbCrLf & vbCrLf & Err.Number & vbCrLf & Err.Description, vbOKOnly,
"Runtime Error"
Resume Err_Exit
End Sub
Private Sub Form_Open(Cancel As Integer)
On Error GoTo Err_Handler
Me![txtStaffID] = Forms![Timesheet]![txtStaffID]
Me![txtStatusID] = 2
Me![cboProjectNumber] =
Forms!Timesheet!TimeSheetDetail.Form![cboProjectNumber]
Err_Exit:
Exit Sub
Err_Handler:
MsgBox "The following error has occurred. Please contact the system
administrator." & _
vbCrLf & vbCrLf & Err.Number & vbCrLf & Err.Description, vbOKOnly,
"Runtime Error"
Resume Err_Exit
End Sub
to add a Note to the current project. I'm trying to initialize the record
with the StaffID, ProjectNumber, and Status, but I'm receiving the error
message 2448: "You can't assign a value to this object." I've
double-checked the form and control names--I don't think there are any typos.
Can anyone explain it?
Sprinks
' Command button code
Private Sub cmdNote_Click()
On Error GoTo Err_Handler
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "ProjectNotes"
DoCmd.OpenForm stDocName, , , stLinkCriteria, acFormAdd
Err_Exit:
Exit Sub
Err_Handler:
MsgBox "The following error has occurred. Please contact the system
administrator." & _
vbCrLf & vbCrLf & Err.Number & vbCrLf & Err.Description, vbOKOnly,
"Runtime Error"
Resume Err_Exit
End Sub
Private Sub Form_Open(Cancel As Integer)
On Error GoTo Err_Handler
Me![txtStaffID] = Forms![Timesheet]![txtStaffID]
Me![txtStatusID] = 2
Me![cboProjectNumber] =
Forms!Timesheet!TimeSheetDetail.Form![cboProjectNumber]
Err_Exit:
Exit Sub
Err_Handler:
MsgBox "The following error has occurred. Please contact the system
administrator." & _
vbCrLf & vbCrLf & Err.Number & vbCrLf & Err.Description, vbOKOnly,
"Runtime Error"
Resume Err_Exit
End Sub