Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Software > Access Forms Coding > Reset form reco...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 5 Topic 41490 of 43412
Post > Topic >>

Reset form recordsource

by =?Utf-8?B?QmVldGxl?= <Beetle@[EMAIL PROTECTED] > Aug 4, 2008 at 10:37 AM

A bit of background to start.

A2003, split, multi-user. I have a form that uses a stored query as it's
recordsource. The query (qryDeliveries) pulls a limited number of records
from the table (the previous 7 days worth). In the header of the form are
unbound controls that are used for searching. When the users do a search
they need to be able to search the entire table, so in the click event of
the Search command button, I change the form's recordsource to a 
SQL statement that is built from what they select in the unbound controls.

That part works perfectly. The part that seems like it should be the
easiest
is giving me headaches. I have a Reset command buuton on the form
where I am attempting to change the form's recorsource back to the
original stored query. I can't seem to get Access to recognize the stored
query. I get a message that says "The recordsource you specified for this
form doesn't exist". I believe I need to use QueryDefs for this, but I
must be
missing something. What I am currently attempting is;

Dim qdf As QueryDef
Set qdf = Currentdb.QueryDefs ("qryDeliveries")

Me.Recordsource = "qdf"

qdf.Close
Set qdf = Nothing

I've tried a few minor variations of the above with no luck. Maybe I'm
wrong
about using QueryDefs for this in the first place. Just for grins I tried 
setting
the recordsource to the query name directly, even though I didn't think it
would work, which it didn't. I'm a little stumped (nothing new <g>). Feel
free to point out if I'm just being an idiot :-)
-- 
_________

Sean Bailey
 




 5 Posts in Topic:
Reset form recordsource
=?Utf-8?B?QmVldGxl?= <  2008-08-04 10:37:01 
RE: Reset form recordsource
=?Utf-8?B?TXIgQg==?= <  2008-08-04 10:45:00 
RE: Reset form recordsource
=?Utf-8?B?QmVldGxl?= <  2008-08-04 11:51:02 
RE: Reset form recordsource
=?Utf-8?B?TXIgQg==?= <  2008-08-04 12:43:08 
Re: Reset form recordsource
Marshall Barton <marsh  2008-08-04 14:05:29 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Mon Dec 1 19:46:01 CST 2008.