Button visible in tabular form

H

HDI

Hi,

How can I make a button visible and change the caption depending on a
field value on a tabular form.

ex:

FieldA FieldB FieldC ButtonA ButtonB

--> Button A is alwas visible, ButtonB is only visible when FieldC is
1.

Thx
 
B

BruceM

You could make a function in the form's code module. That is, open the form
in design view, click View > Code. Click Insert > Procedure. Give it a
name such as ButtonVis, specify that it is a function and that it is public,
and click OK.

Public Function ButtonVis()

If Me.FieldC = 1 Then
Me.ButtonB.Visible = True
Else
Me.ButtonB.Visible = False
End If

End Function

In the form's Current event, and in the After Update event of txtFieldC (the
text box bound to FieldC), and anywhere else you need it, just add:

ButtonVis
 
H

HDI

You could make a function in the form's code module. That is, open the form
in design view, click View > Code. Click Insert > Procedure. Give it a
name such as ButtonVis, specify that it is a function and that it is public,
and click OK.

Public Function ButtonVis()

If Me.FieldC = 1 Then
Me.ButtonB.Visible = True
Else
Me.ButtonB.Visible = False
End If

End Function

In the form's Current event, and in the After Update event of txtFieldC (the
text box bound to FieldC), and anywhere else you need it, just add:

ButtonVis









- Tekst uit oorspronkelijk bericht weergeven -

That doesn't work for a tabular form. When I do that all the buttons
are disabled/enabled and not for that speficic row.
 
B

BruceM

I did not realize that by "tablular form" you meant what is referred to in
Access as a Continuous form. There is no built-in way of doing what you
want (although I don't know abour Access 2007). There may be a third-party
tool, but I cannot point you toward anything specific.
You may be able to work around the problem by making a text box look like a
command button, and use Conditional Formatting to change the backcolor, etc.
so that it blends in with the background.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top