Make delete button visible only for current record

  • Thread starter Thread starter David Robinson
  • Start date Start date
D

David Robinson

I have a subform (continuous form) that lists records from a table. There is
a command button next to each record that serves as a delete button for that
record. Is there a way to make that button visible only for the current
record? I tried using a .visible command in the On Current event but it
makes the button visible for all records.

Thanks.
 
On a continuous form, the button will show the same state on each row.
Enabled, visible, etc. The only thing you could do is to put code in the
OnClick event to manage what happens when clicked. I'm afraid you can't
have the button visible on one line and not the next.
 
I have a subform (continuous form) that lists records from a table. There is
a command button next to each record that serves as a delete button for that
record. Is there a way to make that button visible only for the current
record? I tried using a .visible command in the On Current event but it
makes the button visible for all records.

Thanks.

On a continuous form, there is just one command button, repeated for
each record. You cannot make just one visible or not.

There is no need to have a button on each row to delete that record.
Place a command button in the form's header or footer.
Code it's click event:

DoCmd.RunCommand acCmdSelectRecord
DoCmd.RunCommand acCmdDelete

Place the cursor on any control in the record you wish to delete and
click the command button.
 
I'll give it a try. Thanks.

fredg said:
On a continuous form, there is just one command button, repeated for
each record. You cannot make just one visible or not.

There is no need to have a button on each row to delete that record.
Place a command button in the form's header or footer.
Code it's click event:

DoCmd.RunCommand acCmdSelectRecord
DoCmd.RunCommand acCmdDelete

Place the cursor on any control in the record you wish to delete and
click the command button.
 
Back
Top