Command to Close and Reopen Sub Form 
Author Message
 Command to Close and Reopen Sub Form

I'm using a VB Command to change the SQL statement on my Query
qry_SEARCH
On the main form, frm_SEARCH,  I have a sub form sfrm_SEARCH bound to
this Query

I tried using Me![sfrm_SEARCH].Requery to refresh the data, but that
did not work.
Could i use to close and reopen the Sub Form?
If so what would that look like.
If not is there a better way?

Thanks
Jeff



Sat, 10 May 2008 06:42:12 GMT  
 Command to Close and Reopen Sub Form

Quote:
> I'm using a VB Command to change the SQL statement on my Query
> qry_SEARCH
> On the main form, frm_SEARCH,  I have a sub form sfrm_SEARCH bound to
> this Query

> I tried using Me![sfrm_SEARCH].Requery to refresh the data, but that
> did not work.

Then try directly requery the forms reocrdset, so, try

me![sfrm_Search].Form.Requery

If the above don't work, then something else seriously is wrong.

Quote:
> Could i use to close and reopen the Sub Form?

No, and in fact, a sub-form does not open,and close in a sense. Remember
text box controls, or any control (including a sub-form control) is a just a
control on the form. You can set what field a text box points to, and in the
case of  a sub-form control, you can set what sub-form that control actually
uses. And, you can have multiple copes of the SAME sub-form on a screen, but
of course the sub-form control would have to have a different name.

--
Albert D. Kallal   (Access MVP)
Edmonton, Alberta Canada

http://www.members.shaw.ca/AlbertKallal



Sat, 10 May 2008 08:48:48 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Closing a form when other form is opening but reopening when all forms closed

2. Reopening a form from the forms on close event

3. reload form without closing and reopening the form

4. Data will not update unless I close form and reopen

5. Close form and reopen hidden ??

6. Data will not update unless I close form and reopen

7. form property values lost after close/reopen

8. RecordsetClone suddently stops working until the form is closed and reopened

9. form property values lost after close/reopen

10. Data will not update unless I close form and reopen


 
Powered by phpBB® Forum Software © phpBB Group