The Parts Check in tab has a query that brings up all parts that are checked out.
A supervisor then checks in the parts by clicking on the hyperlink.
This calls a procedure that sets the parts status to IN, and records the date time and initials of the person who checked in the part.
The issue is, I need the hyperlink to become inactive after its been clicked. I cant have that code execute again.
My code currently sets the entire column as .Enabled = False
How do I set a row in a query to .Enabled = False?
Code:
Option Compare Database
Private Sub Status_Click()
Dim Str_PartNameConcat As String
Dim Str_Initials As String
'Create string for Initials
Str_Initials = Forms![Navigation_Main]![NavigationSubform].Form![txt_CheckInInitials].Value
'Create string for entering into Parts Checkin Table
Str_PartNameConcat = [Part_Set] & ", " & [Size] & ", " & [Machine_Type]
'Update Parts_Set table to "IN"
CurrentDb.Execute "UPDATE T_Part_Sets SET [Status] = '" & "IN" & "' Where Part_Sets_ID = " & Me.Part_Sets_ID
'Insert record into Parts Checkin table
CurrentDb.Execute "INSERT INTO T_Part_CheckIn (Initials, [Part_Set]) VALUES ('" & Str_Initials & "', '" & Str_PartNameConcat & "')"
'Disable row so it cannot be clicked again.
Me!Status.Enabled = False
End Sub
Been learning a lot!
Thanks
-Tevis