Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to correctly code a Button macro on a subform?

Status
Not open for further replies.

dannydanny

IS-IT--Management
Oct 9, 2002
109
DK
Hi,

When designing my subform, I have a button which makes a field on the subform unlocked for editing by the user. If I view my subform, this button works ok. But when I insert the subform into my main (parent) form, the button on longer works. I get an error message...something like the subform doesn`t exist.

I figured I must change the macro code somehow, but I don`t know how. Here is my simple macro code
[Forms]![SubFormName]![FieldNameOnSubForm].[Enabled]

Which part do I have to change so that it will work when I open my parent form and click on this button (which is on the subform)?

Thanks for any info,
Danny
 
Hi

If you are referencing a control on the form where the button and control exist (which you say you are) then

Me.[FieldNameOnSubForm].[Enabled]

will do it, you only need to quote the Forms!...etc if you are refering to another form


Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top