Microsoft Acccess can't find the macro '.'

J

Jeff

Hello,

I have a Form & a SubForm (called subfrmAppointments) in it. Nothing fancy.

In the SubForm is a Text Box to enter a date. Becuase I have the "Format"
set to mm/dd/yy if a user enters an Invalid Date the Default Access msgbox
"The Value you entered isn't Valid for this Field...."
comes up. Which is correct.

BUT when I added the main Form's subform Exit Event (which I need to do some
validation) this new Default Access Msgbox comes up after you click OK on the
above one

"Microsoft Acccess can't find the macro '.'
The macro (or its macro group) doesnt exist, or the macro is new but hasnt
been saved. Note that when you enter the macrogroupname.macroname syntax in
an argument, you must specify the name the macros group was last saved under."

Even if I have NO code at all just by having this Exit Event

Private Sub subfrmppointments_Exit(Cancel As Integer)

End sub

causes this msgbox to appear. I checked that SubForm's Properties for On
Exit & it does say "[Event Procedure]"

Why is this msgbox coming up ?? How can I stop it ??

Any help would be greatly appreciated.

Thank you,
Jeff
 
6

'69 Camaro

Hi, Jeff.
Why is this msgbox coming up ?? How can I stop it ??

The form, subform, or a control on either of these objects has an event
property with one or more spaces typed in it. It's hard to find which event
is causing this error, but it's often due to an "OnCurrent" event or
"OnGotFocus" event with a space accidently typed in the combo box.

You also apparently have the subfrmppointments_Exit( ) misspelled. Is the
name missing an "A"?

HTH.

Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips.

(Please remove ZERO_SPAM from my reply E-mail address, so that a message
will be forwarded to me.)


Jeff said:
Hello,

I have a Form & a SubForm (called subfrmAppointments) in it. Nothing fancy.

In the SubForm is a Text Box to enter a date. Becuase I have the "Format"
set to mm/dd/yy if a user enters an Invalid Date the Default Access msgbox
"The Value you entered isn't Valid for this Field...."
comes up. Which is correct.

BUT when I added the main Form's subform Exit Event (which I need to do some
validation) this new Default Access Msgbox comes up after you click OK on the
above one

"Microsoft Acccess can't find the macro '.'
The macro (or its macro group) doesnt exist, or the macro is new but hasnt
been saved. Note that when you enter the macrogroupname.macroname syntax in
an argument, you must specify the name the macros group was last saved under."

Even if I have NO code at all just by having this Exit Event

Private Sub subfrmppointments_Exit(Cancel As Integer)

End sub

causes this msgbox to appear. I checked that SubForm's Properties for On
Exit & it does say "[Event Procedure]"

Why is this msgbox coming up ?? How can I stop it ??

Any help would be greatly appreciated.

Thank you,
Jeff
 
A

Allen Browne

Use the BeforeUpdate event of the subform to perform the record-level
validation. It always fires if there is a change, before the record is
written. It may already be written before the Exit event fires.

Aside from that logic, though, it does sound like Access has something
confused here. To fix the issue:
1. Delete the event procedure, and clear the On Exit property. Save. Close.

2. Uncheck the Name AutoCorrect boxes under:
Tools | Options | General
Explanation:
http://members.iinet.net.au/~allenbrowne/bug-03.html

3. Decompile a copy of the database by entering something like this at the
command prompt while Access is not running. It is all one line, and include
the quotes:
"c:\Program Files\Microsoft office\office\msaccess.exe" /decompile
"c:\MyPath\MyDatabase.mdb"

4. Compact the database.

5. Open the database again. Open any code window. Choose Compile from the
Debug menu. Fix any error, and repeat until there are no errors.

6. Enter the event procedure you want again.
 
J

Jeff

Allen & Gunny, thank you for your replies !

Allen, even thought I didnt exactly try what you told me
I believe you are right. I beleive the Form got currupt in some way or as
you say Access got something wrong.

What I did was create a brand new Form & then copied all the Controls from
the original & then all the code as & now it works fine, that msgbox no
longer appears. Something must of "broke" & by creating this new form it
fixed the problem.

Allen I will save what you wrote in case for the future becuase your way was
probably better & definitley faster.

But anyone else who reads can also try I did.

Thank you both very much,
Jeff
 

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