X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
   Reply to this topicStart new topic
> Boolean Declaration, Access 2013    
post Jun 14 2019, 01:06 PM

Posts: 108
Joined: 29-October 18


I click a cmd and it sets a Public Boolean, Opens a new Form with a Primary Key in OpenArgs to a new form.

Once in the new form, the OpenArgs are set to determine which profile I am using.

I click a subForm in my new form and that event triggers something that I need the original Boolean for.

What are my options to reference the Boolean that was set at the beginning?

Thanks for any help.
Go to the top of the page
post Jun 14 2019, 01:15 PM

UA Admin
Posts: 37,617
Joined: 20-June 02
From: Newcastle, WA

I would use a TempVar in preference to a Public Variable for this task.

That said, declare the Public Variable in a PUBLIC, stand-alone VBA module, not in a form module.

You can then ASSIGN A VALUE to the variable in the form module when you need to do so.

And later, you can retrieve the value from the Public Variable as needed.

Me.ThisValueIsNeededNow = booPublicVariableSetElsewhere

My Real Name Is George. Grover Park Consulting is where I did business for 20 years.
How to Ask a Good Question
Beginning SQL Server
Go to the top of the page
post Jun 14 2019, 01:16 PM

Posts: 3,837
Joined: 27-February 09

Any reason you can't just reference it?

if m_blnSomeSetting = True Then
end if
Go to the top of the page
tina t
post Jun 14 2019, 02:00 PM

Posts: 6,739
Joined: 11-November 10
From: SoCal, USA

well, you're dealing with three forms, and more to the point, three form modules, here: your original form, your "new" form, and the subform in the "new" form. if the boolean variable is declared in the same form module where you need to use it, then Piet's direct code will work fine. if not, then George's suggestion of a global variable declared in a stand-alone module, or a TempVar, is the easiest way to go.


"the wheel never stops turning"
Go to the top of the page

Custom Search

RSSSearch   Top   Lo-Fi    4th August 2020 - 09:34 AM