A few things.
Quote:
|
Controls("Forms!frmBookList!fsubSubjectsBook.Form! ID" & i).Value = ""
|
I see a space after the
Form! and before the
ID. Is that a typo in your post or is that how it actually looks in your code? Remove the space if it's in your code.
RuralGuy points out that the subform's controls are not part of the main form's controls even though the actual subform is a control on the main form. So your code may not work.
To put it in plain English, suppose your main form is a crate and your subform is a carton of eggs. I cannot see the eggs themselves. From the crate's point of view, all I see is a crate (the main form) and the carton (subform). Your code references the eggs. You may get an error message saying, "What eggs? I just see the carton." You have to open the carton and look in to see the eggs. That is, you may have to make the subform active to see its controls and reference them using that particular code.
Another note: setting values to "" is not making them NULL. You're assigning and
empty string to all your controls which is actually
something.
Do this:
MyControl = Null
Not this:
MyControl = ""