Are there session Variables in VBA?

  • Thread starter Thread starter Rashar Sharro via AccessMonster.com
  • Start date Start date
R

Rashar Sharro via AccessMonster.com

Hi,

I have a textbox called txtCust_Number that takes in a value from a combo
box on a form called FormA. I then access another form, called FormB that
also has a textbox called txtCust_Number.

How do I carry the same value that is in FormA.txtCust_Number to
FormB.txtCust_Number?

Thanks,

Rashar
 
Rashar

You've described "how" you are trying to do something (copy a value from
from form to another), but not "why". You've described wanting the same
value in two separate forms, but not what business need you are trying to
satisfy by having two separate forms.

If you provide a bit more description of what you are trying to accomplish
(note: not HOW, but what), the 'group may be able to offer an alternate
approach.

Good luck

Jeff Boyce
<Access MVP>
 
Thank you Jeff.

Here is what I am trying to a complish.

- FormA has a navigation pane that has an item called Products.
- Once I click on Products, it takes me to a form called frmProducts that
still resides in FormA.
- frmProducts has a subform called sfrmProducts that runs a query called
qryproducts.
- So when my frmProducts opens, I need to pass the value of txtCust_Number
(which is populated from a combo box) from FormA to my form frmProducts.
- Now, when frmProducts opens, I will be pulling all the records for that
particular customer based on the selection from my combo box.

Thanks,

Rashar
 
Rashar

I don't understand why you are using one form to "gather" a CustomerNumber
and a different form to display products related to that customer number.
Is there, perhaps, a business need that your first form is satisfying beyond
what you've described in your posts?

If not, another approach would be to use a single form, use a combo box to
select a customer, and either a listbox or a subform to display all related
products -- it really depends on what you need the list for. Again, I am
asking what you want to be able to do, rather than how you've already
decided to do ?it?

Good luck

Jeff Boyce
<Access MVP>
 
Use the OpenArgs property in FormA where you open frmProducts to pass the
value of txtCust_Number to frmProducts. Then in the Open event of
frmProducts, you can do what you need to do to pass it to the query.
 
Hi,


A public variable in the declaration section of a standard module (NOT
form/class/report) will be visible by every one, but will die as the
application ends. You can use database properties if you want some
persistency in the database used to support the application, without having
to pass by a table.


CurrentDb.Properties.Append CurrentDb.CreateProperty("TotoInKansas",
dbText, "Not anymore")

? CurrentDb.Properties("TotoInKansas")
Not anymore

CurrentDb.Properties("TotoInKansas")="In lalala land"



Hoping it may help,
Vanderghast, Access MVP
 
Back
Top