A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

!Recordset from a parameterized query, as the form's recordset. Problem on sorting...



 
 
Thread Tools Display Modes
  #1  
Old June 23rd, 2004, 09:07 AM
Savvoulidis Iordanis
external usenet poster
 
Posts: n/a
Default !Recordset from a parameterized query, as the form's recordset. Problem on sorting...

Access 2000, multiuser MDE app
I use a parameterized query to fill a form or subform with records from a
back end DB in datasheet mode.
The form/subfrm initially does not have any recordsource set.
I manually set the form's recordset in form's open after I fill the parms of
the query and run it.

qdf.parameters(0).value= xxx
set rst=qdf.openquery...
set me.recordset = rst

I set the recordset this way, so that I don't get the ugly Access parameter
window when the form opens
and is based on a parameterized query.

All fine up to now.
Now, when I use the sort toolbar button, I get that ugly Access parameter
window. Why?
Doesn't the sort occur on the local recordset in the form? Is access trying
to requery again?

How can I overcome this?






  #2  
Old June 23rd, 2004, 10:17 AM
Nikos Yannacopoulos
external usenet poster
 
Posts: n/a
Default !Recordset from a parameterized query, as the form's recordset. Problem on sorting...

Iordani,

I suppose one way around it would be to use a global variable to store your
parameter value, and set the criterion in the query to read that value from
the global variable through a function instead, so even if Access needs to
rerun the query to sort, it will find the parameter value stored in the
variable again, rather than ask the user for input.
Alternatively, you could use a custom button for sorting, so everything is
handled through code (pass the parameter value and sort the recordset on
opening it), but that is propably more complicated.

HTH,
Nikos

"Savvoulidis Iordanis" wrote in message
...
Access 2000, multiuser MDE app
I use a parameterized query to fill a form or subform with records from a
back end DB in datasheet mode.
The form/subfrm initially does not have any recordsource set.
I manually set the form's recordset in form's open after I fill the parms

of
the query and run it.

qdf.parameters(0).value= xxx
set rst=qdf.openquery...
set me.recordset = rst

I set the recordset this way, so that I don't get the ugly Access

parameter
window when the form opens
and is based on a parameterized query.

All fine up to now.
Now, when I use the sort toolbar button, I get that ugly Access parameter
window. Why?
Doesn't the sort occur on the local recordset in the form? Is access

trying
to requery again?

How can I overcome this?








  #3  
Old June 24th, 2004, 08:52 AM
Savvoulidis Iordanis
external usenet poster
 
Posts: n/a
Default !Recordset from a parameterized query, as the form's recordset. Problem on sorting...

Efxaristw patrida...

Thanks, but I prefer the access way...
So there is no other way ?

PS...Using Access for almost a year, after programming in other DB tools
(Powerbuilder mainly) I get to believe that Access lacks certain (although
simple) simple programming/design features that everybody might need,
although it comes from Microsoft which is known for its good user interface
tactics



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 09:43 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.