Print Value from a subform (1 Viewer)

Valentine

Member
Local time
Today, 05:13
Joined
Oct 1, 2021
Messages
261
I have a subform that has 1 item in it, the Validation date of my item. On the form the subform is linked through item and displays the date properly. I have a button that I am using to send out an email but want to include the date value in the email. I cannot use Me.value because it is in the subform and not the form. How do I add that value to the email?
 

Valentine

Member
Local time
Today, 05:13
Joined
Oct 1, 2021
Messages
261
wow that was more then I expected it to be but it works now I had to do a little more work but mine looks like this:

Forms("Copy of CAPESform").[Subform Capes to Validation].Form.[Validation Date]

my main form is called "Copy of CAPESform"
Subform called "Subform Capes to Validation"
field inside the subform I am printing is called "Validation Date"
 

Gasman

Enthusiastic Amateur
Local time
Today, 10:13
Joined
Sep 21, 2011
Messages
14,319
So? You were saying you could not use Me.Value?
That indicated to me that the code was in the mainform?
I would only use your syntax if I was trying to get a value from a subform in another open form. NOT the one I am in?

Why make it harder than it needs to be?
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 05:13
Joined
Feb 19, 2002
Messages
43,302
Keep in mind that when you reference a control on a subform from the main form or some other form, you are referencing the CURRENT record of the subform. Are you positive that you KNOW what the current record is at any point in time? It may not even be visible. Immediately after the subform opens, it will be the first record of the subform. However, if the user has scrolled to the 23 record and clicked there, then THAT is the current record even if he scrolls back and the first record is visible again.

I'm guessing that there is something wrong with the logic of your design if there will only ever be ONE subform record.
 

Users who are viewing this thread

Top Bottom