I am working on a database with a table recording aircraft details ("Aircraft"). Amongst other things, this table contains an identifying field (An alphanumeric string unique to the aircraft) for "Airframe", and another (toggleable yes/no) field "Complete?" showing whether the record for the particular airframe is complete. I need to create a simple form where users can select any aircraft in the table by airframe number and then click on a button to toggle the "Complete?" status in the "Aircraft" table.
I copied another, existing form, that allowed the user to select the airframe number from a pull-down, then display all the information related to the airframe in a new form by clicking on a button embedded within the form.
The new, copied form has a field that allows me to select each aircraft individually (no change from the original), but now I want to change the function of the button so it toggles the "yes/no" status of a field in the "Aircraft" table
The existing code "behind" the button looks like this:
Code:
Private Sub Select_Click()
On Error GoTo Err_Select_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Aircraft"
stLinkCriteria = "[Airframe Number]=" & "'" & Me![Airframe Number] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_Select_Click:
Exit Sub
Err_Select_Click:
MsgBox Err.Description
Resume Exit_Select_Click
End Sub
Can anyone help me by suggesting what I need to do to the button code?
Apologies if this is a really stupid question, I haven't touched Access in years and when I originally wrote this database, it was much simpler. Its been modded by others and I'm a bit (a lot?) out of my depth.
Thanks
Jim