Select statement in Row Source 
Author Message
 Select statement in Row Source

I can't seem to get a SELECT statement to work when I type it directly into
the row source of a combo box.

I can incorporate the SELECT statement into a Query and then reference the
query but I can't seem to reference the SELECT directly from the row source.
Is it possible or can I only refer to a query.

Thanks
Dave
--
David R. Frick & Co., CPA
http://www.*-*-*.com/



Wed, 23 May 2001 03:00:00 GMT  
 Select statement in Row Source
It's possible David -- I do it all of the time. What does your SQL
look like, and what do you mean by "doesn't work"?

For example, in a department table, in the department type field, the
row source is:

SELECT DeptTypeID,DeptType FROM tblDeptType ORDER BY DeptType;

If you use the builder, it puts all manner of brackets and table
prefixes everywhere, which I personally despise <g>. However, either
way works.

Quote:

>I can't seem to get a SELECT statement to work when I type it directly into
>the row source of a combo box.

>I can incorporate the SELECT statement into a Query and then reference the
>query but I can't seem to reference the SELECT directly from the row source.
>Is it possible or can I only refer to a query.

>Thanks
>Dave
>--
>David R. Frick & Co., CPA
>http://www.frick-cpa.com


Vince
*** Remove NOSPAM to reply ***


Wed, 23 May 2001 03:00:00 GMT  
 Select statement in Row Source
Thanks Vince

I went back and tried it and it appears it was syntax errors on my part.

I agree with you about the builder. If I can just write the straight SQL, I
don't seem to have as many problems.

Thanks again for your help.
Dave

Quote:

>It's possible David -- I do it all of the time. What does your SQL
>look like, and what do you mean by "doesn't work"?

>For example, in a department table, in the department type field, the
>row source is:

>SELECT DeptTypeID,DeptType FROM tblDeptType ORDER BY DeptType;

>If you use the builder, it puts all manner of brackets and table
>prefixes everywhere, which I personally despise <g>. However, either
>way works.


>>I can't seem to get a SELECT statement to work when I type it directly
into
>>the row source of a combo box.

>>I can incorporate the SELECT statement into a Query and then reference the
>>query but I can't seem to reference the SELECT directly from the row
source.
>>Is it possible or can I only refer to a query.

>>Thanks
>>Dave
>>--
>>David R. Frick & Co., CPA
>>http://www.frick-cpa.com

>Vince
>*** Remove NOSPAM to reply ***



Wed, 23 May 2001 03:00:00 GMT  
 Select statement in Row Source
David,

It's certainly possible to use an SQL statement directly in the RowSource
property string, so if you are using identical SQL statements for the two
approaches, I'd suspect one of the two following problems:
1.  your SQL statement is too long to fit in the RowSource property (max of
2048 characters), or
2.  your query is sufficiently complex that the performance benefit reaped
from using a saved query avoids some problem that occurs when using the SQL
statement as the RowSource.  (I've never actually seen this occur, although
I've heard others complain of display anomalies occuring when using a
slow-running query as a row source.)

If your SQL statement isn't long enough for #1 to be the problem, you might
consider posting it for examination.  Also, a bit more detail wrt the
behaviour seen when using the SQL statement directly might help in
identifying the problem (e.g.: do you get an error message?  does the combo
box show any data at all?)

Nicole


Quote:
>I can't seem to get a SELECT statement to work when I type it directly into
>the row source of a combo box.

>I can incorporate the SELECT statement into a Query and then reference the
>query but I can't seem to reference the SELECT directly from the row
source.
>Is it possible or can I only refer to a query.



Wed, 23 May 2001 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Updating the R first rows of a SELECT containing an ORDER BY statement

2. ADO/Sybase...Need SELECT statement that will only return 1 row

3. Getting row number variable from a selected row in Excel

4. Help: DBgrid, how to select a row and this will select info for other form

5. How to select the current record only with SELECT statement

6. Syntax for referencing the first row from a recordset in an If Then statement

7. Problem with prepared statement and single row rdoResultset

8. MSFlexGrid Preventing User from Selecting Fixed Col Header Row / Determining User Selected Rows vs. Default Selection.

9. two Inet1.execute statements in a row?

10. How do I select multiple rows from a db grid and save the selected rows into the database directly?

11. Packed Database Row and Type Statement

12. Field Row Source Modified by Front-End

 

 
Powered by phpBB® Forum Software