Is it a popup?
Did adding the RunCommand help?
Allen,
Thanks for helping me.
My form is bound to more than one table. It is a split form that has
member
information on top (first name, last name, phone...) and a subform on
the
bottom that has member's contributions that is bound to a table and/or
query.
When I open my church membership database the Main Menu pops up first
that
has command buttons on it that goes to my forms/reports.
When I exit out of my Main Menu and open my "Members/Contributions"
form
from my Navigation Bar the "Find" button works perfectly, no problems.
It
is
just when I open "Members/Contributions form from my Main Menu that it
will
not work and states "command button is not available".
Thanks,
Terressa
:
Okay, perhaps this is an embedded macro in Access 2007.
The On Click property of the button is the right one.
GoToControl handles the Screen.PreviousControl for you.
The error handing for that is good.
Perhaps you could insert a line above all the others that does:
RunCommand SaveRecord
That should give you an error message if the current record can't be
saved
for any reason (in which case you can't go to a new record
Can we confirm that this is a form that is bound to some table or
query?
Is it a popup form (i.e. you can move it outside the Access window)?
--
Allen Browne - Microsoft MVP. Perth, Western Australia
Reply to group, rather than allenbrowne at mvps dot org.
Allen,
I'm new to posting can you tell?
I went to view code on find button and there was no code.
My "on click" stated this:
OnError Next
GoToControl =[Screen].[PreviousControl].[Name]
ClearMacroError
RunCommand Find
[MacroError]<>0 MsgBox =[MacroError].[Description], Yes, None
This is a form that has church members (first name, last name, etc.)
How do you set focus to ScreenPreviousControl?
Sincerely,
Terressa
:
What's in the code behind your command button?
And what event did you use? On Click?
Is this a bound form? (If not, there's nothing to find.)
Did you SetFocus to Screen.PreviousControl?
When the button's code runs, it has focus, and it is not bound to a
field.
Hi I have a database that I created a Main Menu to go to my
forms,
but when I open the form from my Main Menu my "Find" command
button on my form brings up a dialog box that states
"The command or action isn't available now".
If I open this same form from the Navigation Bar the "Find"
command
button works fine. I don't understand. Can someone help me?