Hey,
I've been learning alot but have one final question regarding my access database.
I have a button that locks certain field on my form Orders and then generates the Invoice form.
However when I click the button it all goes through except I get this error:
Object doesn't support this property or method
Also when I click the button it locks all of the records.
Is there a way to only lock a certain record on which I click the button.
For example If I click the button on Order ID 1 is will only lock that record and no others.
This is the code on the button:
Code:
Private Sub Generate_Invoice_Click()
On Error GoTo Err_Generate_Invoice_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Invoice"
stLinkCriteria = "[Order ID]=" & Me![Order ID]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Text_field.Value = "Invoice Printed"
Me![Order ID].Locked = True
Me![Customer ID].Locked = True
Me![Order Date].Locked = True
Me![Payment Type].Locked = True
Me![Job Description].Locked = True
Exit_Generate_Invoice_Click:
Exit Sub
Err_Generate_Invoice_Click:
MsgBox Err.Description
Resume Exit_Generate_Invoice_Click
End Sub