type of query to use as a RowSource

philfer

Registered User.
Local time
Today, 12:00
Joined
Dec 15, 2008
Messages
29
Hello,

If stored queries are better to use than dynamic queries i.e. in terms of performance and compilation is it better to use a stored query for the row source for a form/report or even a control rather than type in the SQL into the property

Is this also better for performance

Thanks
Phil
 
Phil,

This question really could have been asked in your other thread about Dynamic SQL. It sure looks like you're learning a lot about Access and that's great. But as Dkinley said in the other thread, try to give some more thoughts in your questions. Sometime they can be just rolled into one question, and sometime it's a Google away.

Please refer to the other thread because it answers this question as well.

HTH.
 
SQL entered into the rowsource property is saved as a hidden query anyway, so it's more a matter of whether you want to see it in the database window or not.
 
Sorry HTH

I take your point

You are right I am getting right into Access and VBA at the moment and when I get into something I get over-excited and want to learn everything about it and build the best solution possible straight away.

Thanks for your help
Phil
 
Oh, nothing wrong with that! I'm just happy to see someone having their 'Aha!' moment. :) Just make sure you think a bit more about the question and try to keep them in one/few threads as possible.
 
I reckon that it good practical to only use SQL Statements on demand so you can:

Code:
Function LookupWhatever()
    With Screen.ActiveControl
        .RowSource = "SELECT ... ;"
        Call ListDisplay
    End With
End Function

This is not liked on a form's first control (obviously with Tab Stop = Yes) so you may have to reference the Lookup on the On Activate Event. The ListDisplay does a dropdown if the control is empty.

Simon
 

Users who are viewing this thread

Back
Top Bottom