S
Steven Van Impe
Hi,
I'm trying (in Access97) to make certain buttons appear/disappear when
opening a form, based on data in a hidden form with unbound fields.
The unbound field indicates the status ("", "add", "edit", "link"),
and based on this information I want to have a button either "Edit
record" (if the form is in the normal, browse-only state), "Lock
record" (if the form is in the edit state) or no button at all (in the
link state).
My code (below) doesn't seem to work properly. Both buttons are
"Visible = False" by default, yet they keep showing up. Switching from
"Edit" to "" seems to work, but having both disappear doesn't.
Thanks in advance!
Steven
Private Sub Form_Load()
If Forms![Hidden]![EditMode] = "Add" Then
Forms![Recordings]!Edit.Visible = False
Forms![Recordings]!Lock.Visible = False
End If
If Forms![Hidden]![EditMode] = "Edit" Then
Forms![Recordings]!Edit.Visible = False
Forms![Recordings]!Lock.Visible = True
End If
If Forms![Hidden]![EditMode] = "" Then
Forms![Recordings]!Edit.Visible = True
Forms![Recordings]!Lock.Visible = False
End If
If Forms![Hidden]![EditMode] = "Link" Then
Forms![Recordings]!Edit.Visible = False
Forms![Recordings]!Lock.Visible = False
End If
End Sub
I'm trying (in Access97) to make certain buttons appear/disappear when
opening a form, based on data in a hidden form with unbound fields.
The unbound field indicates the status ("", "add", "edit", "link"),
and based on this information I want to have a button either "Edit
record" (if the form is in the normal, browse-only state), "Lock
record" (if the form is in the edit state) or no button at all (in the
link state).
My code (below) doesn't seem to work properly. Both buttons are
"Visible = False" by default, yet they keep showing up. Switching from
"Edit" to "" seems to work, but having both disappear doesn't.
Thanks in advance!
Steven
Private Sub Form_Load()
If Forms![Hidden]![EditMode] = "Add" Then
Forms![Recordings]!Edit.Visible = False
Forms![Recordings]!Lock.Visible = False
End If
If Forms![Hidden]![EditMode] = "Edit" Then
Forms![Recordings]!Edit.Visible = False
Forms![Recordings]!Lock.Visible = True
End If
If Forms![Hidden]![EditMode] = "" Then
Forms![Recordings]!Edit.Visible = True
Forms![Recordings]!Lock.Visible = False
End If
If Forms![Hidden]![EditMode] = "Link" Then
Forms![Recordings]!Edit.Visible = False
Forms![Recordings]!Lock.Visible = False
End If
End Sub