Make delete button visible only for current record

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.
 
D

Danny Lesandrini

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.
 
F

fredg

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.
 
D

David Robinson

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.
 

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