Access 2000 and newer has a Conditional Formatting option, but it doesn't
work for command buttons. While you can place code in the form's Current
event to make the button visible, the problem is that there is only one
button repeated multiple times. So, what will happen is the button will be
visible when the current record is Null, but it will be visible on all
records of the continuous form.
There are a couple of work-arounds.
1) You could place the button in the form's Header. This would give you only
one button on the form but it wouldn't scroll with the continuous part of
the form. The header part of the form will always be visible above the
detail part which is where the scroll is. You could make this button visible
or not in the form's Current event. It may work better to toggle its Enabled
property instead of its Visible property.
2) Conditional Formatting is available for textboxes. While it won't look
exactly the same, you could create a textbox that looks somewhat like a
button instead of the button. Set its Locked property to Yes and its Enabled
property to No. Use Conditional Formatting to change the Fore and Back Color
properties of the textbox to make them the same as the back color of the
form in order to hide the textbox when the associated field's value isn't
Null. Use the Click event of this textbox to run the code. The "caption" of
the textbox would be a calculated value in the Control Source (example:
="Click Me") and set the alignment property of the textbox to Centered.
--
Wayne Morgan
MS Access MVP
"Francis" <fr**********@m sn.com> wrote in message
news:11******** *************@g 44g2000cwa.goog legroups.com...
Hello i have a continuos form, and i have a command button to help
insert information on a control textbox. But when the text box is not
null, i dont want the command button to show (to the current record
only). What is the code i shall use in the Current Event of Form, in
order to display the command button for each record (for null related
text boxes).
Thanks in advance