Referencing a control in a subform from the main form

D

Destin Richter

I have the following my Access database in the AfterUpdate event section of
my Client field on my main form:

Me.frmOrderDetails!Item.Requery

Basically, it works great in Access 2003. When I select my client in the
Client field, the Item field in the subform section (frmOrderDetails) only
shows data relative to the client. In Access 2007, this requery piece of
code seems to have no effect, and if I select a different client, my subform
data (Item field) doesn't update, showing me records instead related to the
previous client selected. I'll be happy to email out the small database to
anyone who wants to take a crack at it.

Any ideas?

Thank you!

Destin Richter
(e-mail address removed)
 
A

Allen Browne

Destin, see if it makes any difference if you requery the combo/list box by
referring to the form in the subform control:
Me.frmOrderDetails.Form!Item.Requery
Explanation:
http://allenbrowne.com/casu-04.html

If that makes no difference, it could be a timing issue. In what event are
you performing the requery? And what is the RowSource of the combo/list box?
 
D

Destin Richter

Allen, thanks for writing back. It turned out that within Access 2007 I have
to define the "trusted zones" for my databases, otherwise some code simply
will not run. Once I did that, my code worked fine.

Thanks again.

Destin Richter
(e-mail address removed)
www.tribal-software.com
 

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