Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

carry value from one form to another

Status
Not open for further replies.

RBE

Programmer
May 25, 2000
72
US
Is there a way to carry a value from one form to another to still another without leaving the original form open and referenceing it.

I am using MS access 2000 and I have created a series of forms to post and print payable information.
The first form has the ticket #(primary key in table)
the second form uses that ticket # to pull the information it needs and then the report uses the same ticket # to pull the information it needs. I have been just leaving the form open at the bottom of the screen through the whole process but, I am getting a write conflict error, I think is being caused because of the update query being run off of the first form and then running an update query on the second form before the first form is closed. I think that is where the error is comming from. I am wondering if there is a global code that I can write that will hold that ticket number as a variable untill a new one is entered and allow me to close the first form. If not are there any suggestions on how to solve this problem, if so I am very limmited on my VB knowledge, can some one give me a clue on how to write it. Thanks

RBE RBE


Are you 100% sure of where you are going.
 
Without leaving the original form open you need a global variable. Be warned that the nature of an event driven application makes the global volitile.

Make a module and declare the variable Public.

Wil Mead
wmead@optonline.net

 
Add a bas module to your project. Within the bas module, declare a public variable. The variable can be set and read from any one of the forms. (I'm doing this same thing in an Access 2000 project right now in fact) -Chris Didion
Matrix Automation, MCP
 
Can I use the openargs property on the forms to transfer the ticket # between forms. If I can how do I get the queries to see the openargs when I call it? RBE


Are you 100% sure of where you are going.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top