SteveL13
asked on
How make navigation buttons appear if more than one filtered record
I have a form with the navigation buttons not visible by default. But if there is more than one record to be viewed on the form I want the navigation buttons to appear.
How can I do this?
--Steve
How can I do this?
--Steve
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
you mention "more than one filtered record" in your question.
How are you "filtering" the recordset? Are you doing this with the optional "WhereCondition" parameter of the OpenForm method, or do you actually have a filter functionality on your form? If the latter, then you would need to include this method within the code sequence you are using to filter the form as well as in the load event.
How are you "filtering" the recordset? Are you doing this with the optional "WhereCondition" parameter of the OpenForm method, or do you actually have a filter functionality on your form? If the latter, then you would need to include this method within the code sequence you are using to filter the form as well as in the load event.
That's why I'm thinking the Current event, because even if when you load, there is only one record, that could change during usage of the form, so the Current event covers both cases.
mx
mx
Joe,
That would, of course, work. I just didn't see a need to do it on every record.
That would, of course, work. I just didn't see a need to do it on every record.
But 'every record' is when it could change dynamically for 1 to >1 ... if adding, deleting, etc.
If you load and there is one, nav is off. But if you add, now you have two. nav is still off. oops.
mx
If you load and there is one, nav is off. But if you add, now you have two. nav is still off. oops.
mx
ASKER
The form is "filtered" by a query which drives the information to the form.
That's reasonable, and if you delete, same logic applies.
I almost never use the built-in navigation buttons, and have a routine (as I'm sure you do) I use to control the status of my custom navigation buttons, which gets called from a variety of places (Form_Current, Form_Dirty, MoveWhere, ...)
I almost never use the built-in navigation buttons, and have a routine (as I'm sure you do) I use to control the status of my custom navigation buttons, which gets called from a variety of places (Form_Current, Form_Dirty, MoveWhere, ...)
Steve ... pretty sure the Q has been answered.
Dale ... yes, I mentioned deleting above ...
mx
Dale ... yes, I mentioned deleting above ...
mx
Private Sub Form_Load
me.NavigationButtons = me.recordsetclone.recordco
End if