subForm allowedits problem

  • Thread starter Thread starter L Prince
  • Start date Start date
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
 
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!
 
Back
Top