Form/subform problem

  • Thread starter Thread starter Andrew Lake
  • Start date Start date
A

Andrew Lake

Guest
I am having a problem with a form/subform. I have set both forms so that they cannot be edited. If the user wishes to edit the data then I have put a command button on the main form footer which runs code so that AllowEdits=True. However this only enables editing on the main form not on the subform. I have tried adding various bits of code to the appropriate command buttons event procedure to rectify this but with no success. Am I missing something simple? I am a VB beginner so advice would be much appreciated!
 
When you change the allowedits = true, do you also have a second line of code to address the subfrm?
The syntax should be the same, but include the subfrm name.
What syntax are you using?

Matthew
 
Matthew. I think this is where I am going wrong as I have tried using Allowedits with the name of the subform but am not sure how to refer to it. The name of the subform is frmModsubform. I tried Forms!frmModsubform.AllowEdits=True but it sent back an error saying it couldn't find the subform with that name. I then tried Forms("frmModsubform") in its place but that didn't work either. Any ideas??

Thanks

Andrew
 
Try this:
forms![frm name]![subfrm namej].allowedits = True.
If that's not correct, search the help files on subfrm and addressing it from another form. This syntax is close, if not correct.
 

Users who are viewing this thread

Back
Top Bottom