Re: Command Button "Find"



Thank you so much for all of your help. On the 2007 Version there is a
"Search" on the bottom of each form where they can find members there. This
will be good enough.

Sincerely,
Terressa


"Allen Browne" wrote:

So, your choices are:
a) to not use a popup form, or
b) to not use the built-in Find.

If the form needs to be a popup, you could code your own find. Use FindFirst
on the RecordsetClone of the form, and then match bookmarks.

The ribbon is in the main Access window. The popup form is not. The popup
form therefore can't get to the ribbon.

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Terressa" <Terressa@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:A59739BA-6AC7-4A47-A6D8-48B89D0D57C0@xxxxxxxxxxxxxxxx
Yes it is a popup.
No the RunCommand didn't help.
--
Terressa


"Allen Browne" wrote:

Is it a popup?

Did adding the RunCommand help?

"Terressa" <Terressa@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:C7E3FF94-4800-49FA-8593-F587AB45EEF2@xxxxxxxxxxxxxxxx
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


"Allen Browne" wrote:

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
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Terressa" <Terressa@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:563E779A-89AD-45E9-8F1B-B182E86D5F5E@xxxxxxxxxxxxxxxx
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


"Allen Browne" wrote:

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.



"Terressa" <Terressa@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:2E9CC8E2-133B-4B9F-99BB-2E532FABA4FA@xxxxxxxxxxxxxxxx
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?






.