Subform problem

L

Leslie Isaacs

I have a main form called [frm private all] that contains a command button
that opens another (smaller) form called [frm private companies]. The
smaller form contains data that is related to the main form (the main form
contains data about encounters with clients, the smaller form contains the
client info - e.g. address, phone numbers etc.). New clients are added by
clicking the button to open the smaller form, adding the new client, then
closing the smaller form: the OnClose event of the smaller form is
[Forms]![frm private all]![Combo68company].Requery - [Combo68company]
contains the client name.

This all works fine, but today I decided it would be better to have the
smaller form as a subform of the main form, with a button on the main form
to make the smaller form visible/invisible as required. Having created the
subform and set its data source as [frm private companies], then linked the
main form to the subform using the corresponding fields on each, I find that
when I close the subform the event procedure [Forms]![frm private
all]![Combo68company].Requery throws up an error - "Runtime error 2450 -
Microsofs Access can't find the form 'frm private all' referred to in a
macro expression or Visual Basic code".

I can't understand this, because that event procedure is requeried fine when
the smaller form is closed as a seperate form, but not when it is closed as
a subform.

Hope someone can help.

Many thanks
:Les
 

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

Similar Threads


Top