Using Query by typing " SELECT......"

Hello,

When I saw on the addresss sample database, the form Household is uing query 
by just mentioning SELECT......

My question is how can type SELECT then prompt the table to us. I normally 
use grid query, what is the difference using grid query of SQL Query ( is it 
SQL that using SELECT....?)

Many thanks for any idea provided
-- 
H. Frank Situmorang
0
Utf
1/28/2008 3:38:01 AM
access.forms 6864 articles. 2 followers. Follow

2 Replies
597 Views

Similar Articles

[PageSpeed] 20

The RecordSource property of a form can accept:
- a table name
- a query name
- a SQL statement.

You can change the RecordSource property of the form programmatically. For 
example, if the form currently has a RecordSource of:
    SELECT Table1.* FROM Table1;
you could do this in the Open event procedure of your form:
    Dim strSql As String
    strSql = "SELECT Table2.* FROM Table2;"
    Me.RecordSource = strSql
That's assuming Table1 and Table2 have identical fields (same names, and 
same data types.) Some versions of Access will just crash if a field 
suddenly disappears or changes data type.

If you do have several tables with the same fields, you have not built a 
relational database. Most likely, those tables should be combined into one 
table, with an extra field to indicate the category (i.e. whatever reason 
you currentlly have them in different tables.)

-- 
Allen Browne - Microsoft MVP.  Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Frank Situmorang" <hfsitumo2001@yahoo.com> wrote in message
news:BD25E52C-0F9E-47D1-A53C-F3D75442AE8F@microsoft.com...
> Hello,
>
> When I saw on the addresss sample database, the form Household is uing 
> query
> by just mentioning SELECT......
>
> My question is how can type SELECT then prompt the table to us. I normally
> use grid query, what is the difference using grid query of SQL Query ( is 
> it
> SQL that using SELECT....?)
>
> Many thanks for any idea provided
> -- 
> H. Frank Situmorang 

0
Allen
1/28/2008 4:01:03 AM
Click on the Record Source property.  Then click on the ... (3 dots) over to 
the right of the records source property.  This should bring up a query 
grid.  To switch to SQL code, click View/ SQL View.  You can make your query 
in Design View or SQL View.  When you have finished making the query, do not 
save it.  Click on the X instead.  Then click Yes on the popup.

Robert

"Frank Situmorang" <hfsitumo2001@yahoo.com> wrote in message 
news:BD25E52C-0F9E-47D1-A53C-F3D75442AE8F@microsoft.com...
> Hello,
>
> When I saw on the addresss sample database, the form Household is uing 
> query
> by just mentioning SELECT......
>
> My question is how can type SELECT then prompt the table to us. I normally
> use grid query, what is the difference using grid query of SQL Query ( is 
> it
> SQL that using SELECT....?)
>
> Many thanks for any idea provided
> -- 
> H. Frank Situmorang
> 



0
Robert
1/28/2008 9:35:56 PM
Reply:

Similar Artilces:

Using Query by typing " SELECT......"
Hello, When I saw on the addresss sample database, the form Household is uing query by just mentioning SELECT...... My question is how can type SELECT then prompt the table to us. I normally use grid query, what is the difference using grid query of SQL Query ( is it SQL that using SELECT....?) Many thanks for any idea provided -- H. Frank Situmorang The RecordSource property of a form can accept: - a table name - a query name - a SQL statement. You can change the RecordSource property of the form programmatically. For example, if the form currently has a RecordSource of: SELECT ...