ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   EASIER WAY THAN FILLING A RECORDSET? (https://www.excelbanter.com/excel-programming/310361-easier-way-than-filling-recordset.html)

What-a-Tool

EASIER WAY THAN FILLING A RECORDSET?
 
Need to get a record from a field in table A, depending on a match to a
joined field in table B.
I'm filling a recordset with a SQL string, and then loading the first value
into a label. (there will only ever be 1 value returned.)
Filling a recordset seems like the long way to return a single value. Is
there an easier way? Can't get a DLookup to work because of the join
involved.(so I'm assuming)

Heres my query:

SELECT tblShellVersions.Shell FROM (tblShellVersions INNER JOIN
tblShellStats
ON[tblShellVersions].[ID]=[tblShellStats].[tblShellVersions_ID]) WHERE
(((tblShellStats.Alias)='10')) GROUP BY tblShellVersions.Shell ORDER BY
tblShellVersions.Shell;

--

/ Sean the Mc /


"I have not failed. I've just found 10,000 ways that won't work."
- Thomas Alva Edison (1847-1931)



What-a-Tool

EASIER WAY THAN FILLING A RECORDSET?
 
Sorry - wrong group _ ****head!

--

/ Sean the Mc /


"I have not failed. I've just found 10,000 ways that won't work."
- Thomas Alva Edison (1847-1931)

"What-a-Tool" wrote in message
news:IZI2d.11$0j.8@lakeread08...
Need to get a record from a field in table A, depending on a match to a
joined field in table B.
I'm filling a recordset with a SQL string, and then loading the first

value
into a label. (there will only ever be 1 value returned.)
Filling a recordset seems like the long way to return a single value. Is
there an easier way? Can't get a DLookup to work because of the join
involved.(so I'm assuming)

Heres my query:

SELECT tblShellVersions.Shell FROM (tblShellVersions INNER JOIN
tblShellStats
ON[tblShellVersions].[ID]=[tblShellStats].[tblShellVersions_ID]) WHERE
(((tblShellStats.Alias)='10')) GROUP BY tblShellVersions.Shell ORDER BY
tblShellVersions.Shell;

--

/ Sean the Mc /


"I have not failed. I've just found 10,000 ways that won't work."
- Thomas Alva Edison (1847-1931)






All times are GMT +1. The time now is 07:14 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com