Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms Programming / June 2006

Tip: Looking for answers? Try searching our database.

this should be quick

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
T Best - 19 Jun 2006 20:30 GMT
i'm opening up a recordset using the following code. it's an Aggregate
query. how do i call
the resultant value? The SQL code runs ok, i don't get any errors.

Dim TotalPaidIndem
Dim dbs As Database
Dim rst As Recordset
Dim strClaims As String

Set dbs = CurrentDb

strClaims = "SELECT Sum(RCADET.[11#_PD-IND]) AS [SumOf11#_PD-IND] " & _
           "FROM RCACMB INNER JOIN RCADET ON RCACMB.[1#_CLM#] =
RCADET.[1#_CLM#] " & _
           "WHERE (((RCACMB.[1#_CLM#]) Like 'SN*' Or (RCACMB.[1#_CLM#])
Like 'NS*') AND ((RCADET.[10#_DT-OS-]) Between #" &
[Forms]![frmClaimsReportRunner]![txtDtTransStart] & "# And #" &
[Forms]![frmClaimsReportRunner]![txtDtTransEnd] & "#));"

Set rst = dbs.OpenRecordset(strClaims)

i was trying...
TotalPaidIndem = rst.[SumOf11#_PD-IND]

and
TotalPaidIndem = rst.value

but kept getting Method or data member not found.

what am i doing wrong?
TIA
Ted
SteveS - 19 Jun 2006 20:35 GMT
Try using the bang (!) after rst instead of dot (.)

TotalPaidIndem = rst![SumOf11#_PD-IND]

HTH
Signature

Steve S
--------------------------------
"Veni, Vidi, Velcro"
(I came; I saw; I stuck around.)

> i'm opening up a recordset using the following code. it's an Aggregate
> query. how do i call
[quoted text clipped - 28 lines]
> TIA
> Ted
Steve Schapel - 19 Jun 2006 22:39 GMT
Ted,

By the way, as an aside, it is not a good idea to use a # or a - as part
of the name of a field or control or database object.  I would recommend
changing these if you can, and certainly avoid this practice in future.

Signature

Steve Schapel, Microsoft Access MVP

> Try using the bang (!) after rst instead of dot (.)
>
> TotalPaidIndem = rst![SumOf11#_PD-IND]
>
> HTH
T Best - 20 Jun 2006 14:48 GMT
i couldn't agree more. it was like that when i got here. there are so many
queries and reports based on these field names. it would be an absolute
nightmare to change them. maybe one of these days...

thanks so much for the help...that worked. i knew it was something stupid

> Ted,
>
[quoted text clipped - 7 lines]
> >
> > HTH
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.