Solved VBA Function and SQL (1 Viewer)

Teri Bridges

Member
Local time
Today, 05:17
Joined
Feb 21, 2022
Messages
186
I am back. Just when I think I a figuring something out....Nope not a clue!

I have a temp query I created to get my SQL statement. I want to total the lesson duration for each course to determine my course Hours.

The sum of lessons (lesson total) is related to the catalog ID. Currently using the code that I have written, it appears to be counting the # of rows not giving me the sum of lessons. Any help is appreciated.
1699567895809.png
 

Attachments

  • Tracker4a.zip
    1.6 MB · Views: 65

GaP42

Active member
Local time
Today, 20:17
Joined
Apr 27, 2020
Messages
338
If you place a text control in the foot of the subreport: LessonsList_Srpt such that datasource = sum(lessonDuration). Give it a name. The footer can remain hidden.
Back at the top of the main form change the data source for deliveryhours to be the name you assigned to the new text control in the footer in the form of:
for eg: =([LessonsList_Srpt]![TotalLessonDuration])

Result for me shows 4.
 

Teri Bridges

Member
Local time
Today, 05:17
Joined
Feb 21, 2022
Messages
186
I am back. Just when I think I a figuring something out....Nope not a clue!

I have a temp query I created to get my SQL statement. I want to total the lesson duration for each course to determine my course Hours.

The sum of lessons (lesson total) is related to the catalog ID. Currently using the code that I have written, it appears to be counting the # of rows not giving me the sum of lessons. Any help is appreciated.
View attachment 110897
If you place a text control in the foot of the subreport: LessonsList_Srpt such that datasource = sum(lessonDuration). Give it a name. The footer can remain hidden.
Back at the top of the main form change the data source for deliveryhours to be the name you assigned to the new text control in the footer in the form of:
for eg: =([LessonsList_Srpt]![TotalLessonDuration])

Result for me shows 4.
Execllent! Thanks
 

Users who are viewing this thread

Top Bottom