Full Version: Query Results For Form
UtterAccess Forums > Microsoft® Access > Access Forms
CHKarcher
Need VBA code so when I open a form it runs a query and adds a total and puts that total into a unbound text field on the form.
uery called "Q_MyQuery"
Form Unbound Field "My_Sum"
TIA
Steve
ipisors
Can you put this code in your form's Load event?
!--c1-->
CODE
Me.My_Sum.Value=dcount("*","Q_MyQuery")
CHKarcher
I need it to bring a field value from the query instead of counting the records - in the query i have a filed called 'Total'
Thanks
steve
CHKarcher
Got it - DLookup instead DCount worked
teve
This is a "lo-fi" version of UA. To view the full version with more information, formatting and images, please click here.