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
Solved

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

Posted on 2016-11-09
2
41 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
2 Comments
 
LVL 36

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

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

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

This article is a continuation or rather an extension from Cascading Combos (http://www.experts-exchange.com/A_5949.html) and builds on examples developed in detail there. It should be understandable alone, but I recommend reading the previous artic…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
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 “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…

829 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