Solved

how to get value from an object on another access form for global variable

Posted on 2016-11-09
2
48 Views
Last Modified: 2016-11-10
I have a main form  that when open, i'm wanting to set  a global  variable


LABEL_CURRENT_REVIEW_DATE   is a label on  "RUN_BUILD_FORM"

In a module:
Global CSP_REVIEWDATE_CRITERIA  As String



On my main form load event
Private Sub Form_Load()
' this is the main form loading at startup
CSP_REVIEWDATE_CRITERIA = Forms!RUN_BUILD_FORM!LABEL_CURRENT_REVIEW_DATE
End Sub


I cant seem to get the code correct to grab the current value on the form. "RUN_BUILD_FORM"


Thanks
fordraiders
0
Comment
Question by:fordraiders
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 37

Accepted Solution

by:
PatHartman earned 500 total points
ID: 41881073
I'm not sure what you want from a label.  The only property that makes sense in this context is the caption property:
CSP_REVIEWDATE_CRITERIA = Forms!RUN_BUILD_FORM!LABEL_CURRENT_REVIEW_DATE.Caption

BUT, the caption is static.  Are you sure you don't want the value of the textbox the label is attached to?

CSP_REVIEWDATE_CRITERIA = Forms!RUN_BUILD_FORM!thetextboxname
0
 
LVL 3

Author Closing Comment

by:fordraiders
ID: 41882902
thnx
0

Featured Post

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
Use Windows Task Scheduler to print a Word document weekly so your printer ink won't dry out.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question