I have a form which has a button that has a click procedure. Essentially if a checkbox(chkIncludeIDs) is ticked then it has to open a form and make the property of a textbox on that form visible.
My current code for the click event is as follows;
Private Sub Update_pending_Click() On Error GoTo Err_Update_pending_Click
Dim stDocName As String
Dim stLinkCriteria As String
If Me.chkIncludeIDs = 0 Then
stDocName = "Pending Queries Locked"
Else
stDocName = "Pending Queries Locked"
Forms![Pending Queries Locked]!ID.Visible = True
End If
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_Update_pending_Click: Exit Sub
Err_Update_pending_Click: MsgBox Err.Description Resume Exit_Update_pending_Click
End Sub
The form that I open is "Pending Queries Locked" The textbox I need making visible is ID as it's default value is visible = false
For some reason my code isn't working and I'm a little unsure why. :/