B
Bobk
I have a form used in receiving material against a purchase order. The form
is the puchase order header and contains a field "postatus". This field is a
flag indicating whether the purchase order is closed or open. The form has a
button which brings up a linked form showing a summary of all the purchase
order line items and the amounts received and indicates whether the purchase
order is complete or not. On the linked form there is a button for setting
the postatus field to closed. My problem is when the button is clicked I get
the message "You can't assign a value to this object". What is happening?
The code for opening the linked form is:
Private Sub Command147_Click()
On Error GoTo Err_Command147_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmPOrecstatus"
stLinkCriteria = "[ponumber]=" & Me![ponumber]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_Command147_Click:
Exit Sub
Err_Command147_Click:
MsgBox " SELECT A PURCHASE ORDER "
Resume Exit_Command147_Click
End Sub
The code I am using to set the postatus field to closed is:
Private Sub Command40_Click()
On Error GoTo Err_Command40_Click
Me.[postatus] = "CLOSED"
Exit_Command40_Click:
Exit Sub
Err_Command40_Click:
MsgBox Err.Description
Resume Exit_Command40_Click
End Sub
What am I doing wrong?
is the puchase order header and contains a field "postatus". This field is a
flag indicating whether the purchase order is closed or open. The form has a
button which brings up a linked form showing a summary of all the purchase
order line items and the amounts received and indicates whether the purchase
order is complete or not. On the linked form there is a button for setting
the postatus field to closed. My problem is when the button is clicked I get
the message "You can't assign a value to this object". What is happening?
The code for opening the linked form is:
Private Sub Command147_Click()
On Error GoTo Err_Command147_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmPOrecstatus"
stLinkCriteria = "[ponumber]=" & Me![ponumber]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_Command147_Click:
Exit Sub
Err_Command147_Click:
MsgBox " SELECT A PURCHASE ORDER "
Resume Exit_Command147_Click
End Sub
The code I am using to set the postatus field to closed is:
Private Sub Command40_Click()
On Error GoTo Err_Command40_Click
Me.[postatus] = "CLOSED"
Exit_Command40_Click:
Exit Sub
Err_Command40_Click:
MsgBox Err.Description
Resume Exit_Command40_Click
End Sub
What am I doing wrong?