View Full Version : Form/subform problem


Andrew Lake
09-27-2000, 01:26 PM
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!

MatthewDavis
09-27-2000, 07:26 PM
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

Andrew Lake
09-27-2000, 10:08 PM
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

MatthewDavis
09-28-2000, 09:16 AM
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.

Andrew Lake
09-28-2000, 11:14 AM
Many thanks for that will go and give it a try.

Andrew