subForm allowedits problem

L

L Prince

I am trying to control when people can add/edit/delete
records in a subform and am getting an error message
saying that I am not referencing the property properly or
that the property doesn't exist. I can reference the
subform from inside the form events, but I need to do it
when I'm running a VBA module that does a bunch of other
stuff. I've tried various syntax and here's what I've got:

Function EditData()

Set frm = Forms!new_base

....Do stuff

Forms!new_base![Forecast subform].Form.AllowEdits = True
frm![Forecast subform].Form.AllowDeletions = True
frm![Forecast subform].Form.AllowAdditions = True

..... Do more stuff

Any advice?

TIA
 
L

l prince

It must make a difference that the subform is on a page in
a tab control. As long as the focus is on the tab control
page, the VBA code works fine, but if the focus is not on
the tab control, it doesn't work at all. I can
enable/disable the subform, but that's it. Can anyone
offer advice on how to work around this problem? BTW, I'm
using Access 97. Thanks!
 

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