Hi all,
I am trying to hid a command button which links two forms. The forms
are connected by a one-to-many relationship and the second form has
details on the first. But if no details are avaliable I don't want the
command button to appear. I've been working with an "If/Then"
statment, but now the command button never appears.
Here is the statement I have
Private Sub Form_Current()
Dim stDocName As String
stDocName = "Destroyed Files Contents"
If "[Matter Number]" = Me![Matter Number] Then
Destroyed_Form.Visible = True
Else
Destroyed_Form.Visible = False
End If
End Sub
this is the statement linking the two forms
Private Sub Destroyed_Form_Click()
On Error GoTo Err_Destroyed_Form_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Destroyed Files Contents"
stLinkCriteria = "[Matter Number]=" & "'" & Me![Matter Number] &
"'"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_Destroyed_Form_Click:
Exit Sub
Err_Destroyed_Form_Click:
MsgBox Err.Description
Resume Exit_Destroyed_Form_Click
End Sub
Thanks for any help,
Danthrom