Solved Email .HTMLBody to include totals from other Modules or Queries?

Okay, I just read through the posts. Are those two separate procedures populating an open form? If so, you should be able to refer to their values from your code by using a form reference. For example:
Code:
& "Total QTY of Edges: <U>" & Forms!FormName.WSToEd.Value & "</U><br>" _
Hope that helps...
Great, I will try later tonight as soon I can and report back. TY soo much
 
Okay, I just read through the posts. Are those two separate procedures populating an open form? If so, you should be able to refer to their values from your code by using a form reference. For example:
Code:
& "Total QTY of Edges: <U>" & Forms!FormName.WSToEd.Value & "</U><br>" _
Hope that helps...
I tried it but didnt worked. Do you think I may need to add a DIM as RecordSet?
It gave me an Error to debug

Ohhh also, these values are coming from a Closed form.
Maybe using the VBA posted at the beginning of the thread as reference will be a better approached? Since the VBA is getting values from a query. IDK :(
 
Last edited:
What was the error message?
Edit: This error happened because I had that form opened in Design View.
Discard this post, Next post is correct


1640795225679.png


1640795310618.png
 
Last edited:
OMG God guys!!
That's it, thats the problem..

So I created the email report with the Forms Opened and @theDBguy code works perfect but Only works with Open Form not Closed

View attachment 97212
Unfortunately, you cannot pull any data from a closed form. So, yeah, if you want to pull the information from a form, it has to be open. Otherwise, you can try to pull it from the source table instead. Cheers!
 
Unfortunately, you cannot pull any data from a closed form. So, yeah, if you want to pull the information from a form, it has to be open. Otherwise, you can try to pull it from the source table instead. Cheers!
Ok, thanks sooo much mate... I will dig into that to see what I come up to.
Should I post here if I make it work that way even though is not related to the thread title? @theDBguy
 
Ok, thanks sooo much mate... I will dig into that to see what I come up to.
Should I post here if I make it work that way even though is not related to the thread title? @theDBguy
If only to tell us you got it to work another way, it's okay to post here. However, if it was to ask a question about another approach, maybe it's better to start a new thread. Good luck!
 
I was thinking,
Is it possible to have those 2 Forms open in the background (Hidden) once you open the database front end?
 
as a new tab but never actually open it because I run the report from a Dashboard button that populate the Report and a Form with a Click.
Not sure what you mean by "a new tab," but if you're using a Click to open the report that needs the form as well, then you should be able to add code to open the form as hidden first, before opening the report.
 
Not sure what you mean by "a new tab,"
By that, I mean, I was hoping you would tell me you double-click on the form's name on the Navigation Pane, or you click on a button from your menu form, etc.
 

Users who are viewing this thread

Back
Top Bottom