how to change the source of a closed form ?

  • Thread starter Thread starter mchd
  • Start date Start date
You have to have it open in design view to do this.

But your users don't need to see what you do. See Help for docmd.echo
 
mchd said:
I thought it was obvious that i wanted to solve the probleme by code.

Yes, I thought so too.

docmd.openform yourformname, acdesign
forms!yourformname.recordsource=yoursource
docmd.close acform, yourformname, acsaveyes
 
In form to be opened, leave RecordSource empty.

In the event that calls the form to be opened, after the open call
insert a line that says something like:

Forms!frmMyFormName!RecordSource = "qryMyQuery"

I can't remember if you need the quotes, if this doesn't work, try
removing them.
 
Back
Top