Add events to rectangles in Access 2007

R

roccogrand

I have several command buttons on a form. I would like to set them off with
colored rectangles and pictures, and allow users to click anywhere within the
area bounded by the rectangle to open a form.

In Access 2003 I was able to add events like Open Form to rectangles. Is
that still possible with Access 2007? And can I add events to pictures?

Any ideas?

LDN
 
G

Graham R Seach

Assign the rectangle a BackColor, and use the rectangle's Click event.

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia
 
R

roccogrand

Thanks.

I don't know that much code so I had to open an old Access 2003-2000
database and copy the code for opening a form into my Access 2007
application. Not my preferred workflow but without integrated VBA in Access
2007 I guess this is the only thing that an old man can do.

LDN
 
G

Graham R Seach

Sorry, am I missing something? I thought your original question was asking
if you could add events to a rectangle.
Uhm, now I'm really confused. Access 2007 does have VBA.

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia
 
R

roccogrand

Access 2007 supports VBA but it is not the default for .ACCDB files.
Instead, .ACCDB uses macros. I tried using macros with graphics to open
forms but it wouldn't work like it did in Access 2003. Also a friend sent me
to a site that said that users cannot turn off macros and use wizard-based
VBA, like in 2003.

As I stated in my last post I was able to add VBA code to my application by
opening an Access 2003-based application and copying the code into event
statements in my Access 2007 database. This is a pain if you have lots of
graphic icons like I do in an application.

If you know how to disable macros, please advise. I would even be willing
to hack the registry to permanently revert to wizard-based VBA if I had to do
so. I understand why MS did this but I am trying for a new look in my
applications and it is important to me that I have the power to do innovative
things quickly with my applications. And I don't want to give up on
multivalue fields, I like them.

LDN
 
G

Graham R Seach

Oh, OK; I see what you mean now. No, there's no way to have the wizards
create VBA in preference to embedded macros. That's just the way it works
now.

Personally, I've never liked wizard-generated VBA. Frankly, it just wasn't
very good. It would have been OK if we could create our own wizard-generated
code, but alas...

You still have the power to do innovative things. In fact, there are a few
more niceties in Access 2007 that allow you to be even more innovative. I'm
afraid if you want to do this kind of thing now, you're going to have to
take the plunge and learn VBA. Once you do, you'll never go back to
"script-kiddy land".

Multi-valued fields? Phffft !! Abomination!! There is at least one poor guy
in the Access product group who breaks into a cold sweat at the prospect of
talking to us (MVPs) about multi-valued fields, given that we roasted him
alive a few years back. But if you like them, you still have the ability to
use them in VBA. In fact, you have more power to use them in VBA than you do
with macros. Take the plunge!

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia
 
R

roccogrand

Thanks again Graham for your comments. They put a smile on my face. Not
being face to face I can't read yours.

The multi-value issue is definitely one that has folks on one side of the
issue or the other. I am waiting for more of the guys and gals in my Access
users to start using these fields. The discussions will get lively I am
sure.

Tell your friend in the Group that he is not alone in his evangelism of
multi-value fields. As Max Planck said, old ways of doing things are given
up when their advocates die off. By the time that Access 14 (MS will
probably skip 13) rolls around there should be very few users out there who
aren't using multi-value fields in their applications. If you know of any
articles about coding multi-value fields, I would much appreciate knowing
about them.

The problem with learning VBA for me is more an issue of time than anything
else. Database design and development is not my job and the differences
between ADO and DAO is taking me a long time to figure out. Frankly, the
tools in Access made me a "Wizard Weenie". I need to take a VBA class but I
just don't have time.

Have a great day!

LDN
 

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