Subform with button visibility

G

Guest

I have a subform for books being borrowed and being returned where each copy
of the book is listed in the subform. I have a borrow button and a return
button on top of each other. I want the button to become visible if the book
is available and the return button to be visible if it is being borrowed. I
have the action to change the visibility on the current event of the subform.
The problem I am having is that when it runs, it changes all of the buttons
to either one or the other and will only change to the correct one when I go
to the record that is either borrow or return. Which action would go through
all the records in the continuous form and change each button visibility
separately or is there no way to change visibility per record on a continuous
form?
 
M

Marshall Barton

twen said:
I have a subform for books being borrowed and being returned where each copy
of the book is listed in the subform. I have a borrow button and a return
button on top of each other. I want the button to become visible if the book
is available and the return button to be visible if it is being borrowed. I
have the action to change the visibility on the current event of the subform.
The problem I am having is that when it runs, it changes all of the buttons
to either one or the other and will only change to the correct one when I go
to the record that is either borrow or return. Which action would go through
all the records in the continuous form and change each button visibility
separately or is there no way to change visibility per record on a continuous
form?


You can not use code to manipulate control properties for an
individual row in a continuous or datasheet form.

The usual thing to do in a case like you have is to use
Conditional Formatting (Format menu) to disable the buttons.

I am not sure what condition/expression you would use in CF.
If each book record has a yes/no CheckedOut field, then the
return button's condithion would be like:
Not [CheckedOut]
and select the Enabled property.
 

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