Button Event Procedure

M

Mike from Moriches

While adding a form to a database, I couldn't get a button's "On Click"
Event Procedure to trigger. I went back to some previously working forms,
and their buttons now also won't trigger an event. Is there some master
setting that cripples events on forms? The buttons on the switchboards work
properly.
I'm a step up from a newbie in Access 2007, but this one puzzles me. Any
help will be appreciated.
Mike from Moriches
 
D

Damon Heron

When you open the form in design view, and follow the event property to the
VB window, what is the code for the event?

Damon
 
M

Mike from Moriches

In this example there is an unbound text box named Condo and a button named
Locate. Other forms that used to work, but no longer do, are similar.
* * * * * * * **
Private Sub btnLocate_Click()
On Error GoTo Err_btnLocate_Click
Dim gstrFindItem As String
Dim kondo As String
gstrFindItem = ""
'See if User entered a Condo number
If Not IsNothing(Me!Condo) Then
kondo = Me!Condo
gstrFindItem = "[CondoNo] LIKE " & Chr$(34) & kondo & "*" & Chr$(34)
GoTo work
End If
work:
DoCmd.OpenForm "frmOwnerArchitectural", , , gstrFindItem
Exit_btnLocate_Click:
Exit Sub
Err_btnLocate_Click:
MsgBox Err.Description
Resume Exit_btnLocate_Click
End Sub
* * * * * * * * * *
 
L

Linq Adams via AccessMonster.com

Were you originally running this app in an earlier version of Access? Have
you, perhaps, moved the database to a new folder on your hard drive or onto
another machine?

Code does not run in 2007 unless your database resides in a folder that has
been declared a “trusted†location.

To trust your folder, click:

Office Button (top left)
Access Options (bottom of dialog)
Trust Center (left)
Trust Center Settings (button)
Trusted Locations (left)
Add new location (button)
 
M

Mike from Moriches

Yes, it is listed in the "Trusted Locations" The application has been
working for many months. It's only been since I attempted to add a new
table with some new forms that the problem developed. The Switchboard
buttons do work, but none of the buttons on forms (at least all I tried)
work. It's weird.
 
L

Linq Adams via AccessMonster.com

You're not approaching the 2 GB limit are you? Access starts doing all kinds
of weird things when this happens, literally running out of the internal
memory to do everyday things. If this isn't so, and with nothing having
changed, it sounds like some kind of corruption. I guess you need to do the
usual things. Import everything into a new, blank database; amazingly, this
simple act frequently eliminates corruption.

Do you have a backup copy, before the added table/forms, to go back to? If so,
back that one up and then try again, adding one object at a time, then
testing, to isolate the culprit, assuming it bombs again.

Good luck!
 
M

Mike from Moriches

It's 20,200 KB. Yes, I do have a backup, so I guess, I'll take that route.
If I do discover what caused the problem, I'll let you know. Thanks for
your time and help.
Mike
 

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