Web Development

General discussion


Access 2000 Sub Forms

By MRA2 ·
I have a Parent Child Database. The Parent has Names & Addresses, while the Child has payment dates & amounts.

Sometimes I want to put check the "NO PAY" box on the Main Form. I wanted the Subform Payment field to be disabled.

In the Main form I checked the "NO PAY" box for 2 Names so that "NO PAY" = -1.

IN the payment field on the subform I put the following code and it does NOT work. Cannot find the Form Name.

In the On Current event of the subform:

If ([forms]![Parent Form]![NO PAY] = -1) then
me.payment.enabled = false
end if

Obviously I am addressing the Main Form with the incorrect format. Can anyone out there help me???

New York City

This conversation is currently closed to new comments.

Thread display: Collapse - | Expand +

All Comments

Collapse -

by dryflies In reply to Access 2000 Sub Forms

what is the association between the parent form and the subform. for example, you might have parent name in the child table to associate the child with the parent. I would iterate through the records of the subform that are associated with the parent record and set the disabled attribute using odbc or adodb. if I had a better understanding of your DB icould answer more precisely. also, instead of doing an if, a logical not would be faster.

please rate my answer.

Collapse -

by MRA2 In reply to

Poster rated this answer.

Collapse -

by MRA2 In reply to Access 2000 Sub Forms

This question was closed by the author

Related Discussions

Related Forums