Hi All,
I am trying to requery a subform after adding a record. Using vba in Access 02 I put the following code in the onClose event of the form for adding records.
Forms!frm201!sbf211.Requery
I get this error message
Microsoft Access can't find the field "sbf211" referred to in your expression
I found a syntax described for referencing subForm controls as follows
Forms!frm201!sbf211.Forms.Requery
The same error message comes up. I found a kb article suggesting the recordsource be set to "", then reassigned so I tried this code.
Forms!frm201!sbf211.Forms!RecordSource = ""
Forms!frm201!sbf211.Forms!RecordSource = "qry211"
I am out of things to try. Perhaps properties are accessed differently than controls but I can't find a description. Any suggestions would be much appreciated.
Thanks,
alr
_____________________________________
If a large part of intelligence is the ability to generalize, it is ironic that a large part of what we call wisdom is the ability not to generalize.
I am trying to requery a subform after adding a record. Using vba in Access 02 I put the following code in the onClose event of the form for adding records.
Forms!frm201!sbf211.Requery
I get this error message
Microsoft Access can't find the field "sbf211" referred to in your expression
I found a syntax described for referencing subForm controls as follows
Forms!frm201!sbf211.Forms.Requery
The same error message comes up. I found a kb article suggesting the recordsource be set to "", then reassigned so I tried this code.
Forms!frm201!sbf211.Forms!RecordSource = ""
Forms!frm201!sbf211.Forms!RecordSource = "qry211"
I am out of things to try. Perhaps properties are accessed differently than controls but I can't find a description. Any suggestions would be much appreciated.
Thanks,
alr
_____________________________________
If a large part of intelligence is the ability to generalize, it is ironic that a large part of what we call wisdom is the ability not to generalize.