Solved

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

Posted on 2016-11-09
2
32 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 34

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
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…

919 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now