473,385 Members | 1,593 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Passing variables between two open .mdb files

I have an application where App1.mdb calls App2.mdb when a button is
clicked on a form.
App1 has three values of interest:
1. gblPgmPath
2. frmMain1.txtSubTotalVariance
3. frmMain1.txtSubTotalVariancePct
The two txt fields are calculated realtime.

When App2 is launched from App1, App1 has frmMain1 open and stays open
even after work in App2 is completed and closed.
App1 has a value in the gblPgmPath variable and two values in text
boxes in frmMain1 that App2 needs to reference.

Over in App2, what is the syntax for referencing the "gbl" variable
and the two text boxes in frmMain1 so that I can retrieve their values
successfully?

Thanks.

Jul 26 '07 #1
9 3521
rl*********@yahoo.com wrote:
I have an application where App1.mdb calls App2.mdb when a button is
clicked on a form.
App1 has three values of interest:
1. gblPgmPath
2. frmMain1.txtSubTotalVariance
3. frmMain1.txtSubTotalVariancePct
The two txt fields are calculated realtime.

When App2 is launched from App1, App1 has frmMain1 open and stays open
even after work in App2 is completed and closed.
App1 has a value in the gblPgmPath variable and two values in text
boxes in frmMain1 that App2 needs to reference.

Over in App2, what is the syntax for referencing the "gbl" variable
and the two text boxes in frmMain1 so that I can retrieve their values
successfully?
When you say "App1.mdb calls App2.mdb" - what does that mean exactly?

There are several ways you could accomplish this but you won't (easily)
be able to get the values of variables in another instance of Access.

But, its trivial to use SQL to write values from one .mdb to another.

For example - in code you could do this from App1.mdb (regardless of
whether App2.mdb is open or not):

CurrentDB.Execute "UPDATE PassedParameters IN '" & CurrentProject.Path & _
"\App2.mdb' SET PgmPath = '" & gblPgmPath & "';", dbFailOnError

Some assumptions: App2.mdb is in the same folder as App1.mdb (if not
then remove "CurrentProject.Path" and replace with the path.

Your PassedParameters table in App2.mdb has only one row otherwise
you'll most likely want to limit what rows are updated by using a WHERE
clause in the SQL.

And.. your PassedParameters has at least one row (or the SQL will fail).
You should add error handling in your code anyway.

I also didn't deal with the form values but the example should give you
the general idea.

Another method would be to write values to a text or XML file from App1
and read them in App2.

--
'--------------------------
' John Mishefske
' UtterAccess Editor
' 2007 Microsoft Access MVP
'--------------------------
Jul 28 '07 #2
On Jul 26, 11:55 am, rlntemp-...@yahoo.com wrote:
I have an application where App1.mdb calls App2.mdb when a button is
clicked on a form.
App1 has three values of interest:
1. gblPgmPath
2. frmMain1.txtSubTotalVariance
3. frmMain1.txtSubTotalVariancePct
The two txt fields are calculated realtime.

When App2 is launched from App1, App1 has frmMain1 open and stays open
even after work in App2 is completed and closed.
App1 has a value in the gblPgmPath variable and two values in text
boxes in frmMain1 that App2 needs to reference.

Over in App2, what is the syntax for referencing the "gbl" variable
and the two text boxes in frmMain1 so that I can retrieve their values
successfully?

Thanks.
Is this a different question than you asked in
"Sharing variables/objects between two open .mdb files"
posted two days ago
(http://groups.google.com/group/comp....ms-access/msg/
8c46fa6e60126fcd)
?

If not, was none of the answers satisfactory?

Jul 28 '07 #3
rkc
lyle wrote:
On Jul 26, 11:55 am, rlntemp-...@yahoo.com wrote:
>I have an application where App1.mdb calls App2.mdb when a button is
clicked on a form.
App1 has three values of interest:
1. gblPgmPath
2. frmMain1.txtSubTotalVariance
3. frmMain1.txtSubTotalVariancePct
The two txt fields are calculated realtime.

When App2 is launched from App1, App1 has frmMain1 open and stays open
even after work in App2 is completed and closed.
App1 has a value in the gblPgmPath variable and two values in text
boxes in frmMain1 that App2 needs to reference.

Over in App2, what is the syntax for referencing the "gbl" variable
and the two text boxes in frmMain1 so that I can retrieve their values
successfully?

Thanks.

Is this a different question than you asked in
"Sharing variables/objects between two open .mdb files"
posted two days ago
(http://groups.google.com/group/comp....ms-access/msg/
8c46fa6e60126fcd)
?

If not, was none of the answers satisfactory?
I found yours quite satisfying.
Jul 28 '07 #4
On Jul 28, 10:30 am, rkc <r...@rkcny.yabba.dabba.do.comwrote:
I found yours quite satisfying.
That's frightening as previously only polite redheads (all were
females) have said that to me.

Jul 30 '07 #5
rkc
lyle wrote:
On Jul 28, 10:30 am, rkc <r...@rkcny.yabba.dabba.do.comwrote:
>I found yours quite satisfying.

That's frightening as previously only polite redheads (all were
females) have said that to me.
You're right. I am none of the three.
Jul 30 '07 #6
Is this a different question than you asked in "Sharing variables/objects between two open .mdb files" posted two days ago?
(http://groups.google.com/group/comp....ms-access/msg/
8c46fa6e60126fcd)
It probably is the same. The reason I posted again was that I cannot
retrieve the "Sharing variables/objects between two open .mdb files"
thread at all. I tried it on several different computers even...no
luck..not sure why.
I can retrieve lots of message threads from this group, but the one in
question isn't one of them, not sure why.
If you can post the replies in this thread, that would be helpful & I
apologize for making an extra step for you here; not my intention.

Thanks.

Jul 30 '07 #7
When you say "App1.mdb calls App2.mdb" - what does that mean exactly?

In App1, there is a button on a form that lunches app2. Yes, they are
in the same folder.
App2 uses some information from App1 that has to get passed in to the
2nd progrma.

After reading the thread (all responses), at a high level 2 options
would be to
1) have App1 write an ASCII text file out in the same folder. When
app2 starts, have it read in variables written to the text file.
2) have a 3rd .mdb file that is linked up to App1 and App2 called
App3Shared.mdb. App1 writes the values to a table in App3Shared.mdb
and when App2 is launched it simply reads the table in App3Shared and
brings in the values at startup.

Jul 30 '07 #8
On Jul 30, 10:52 am, rlntemp-...@yahoo.com wrote:
Is this a different question than you asked in "Sharing variables/objects between two open .mdb files" posted two days ago?
(http://groups.google.com/group/comp....ms-access/msg/
8c46fa6e60126fcd)

It probably is the same. The reason I posted again was that I cannot
retrieve the "Sharing variables/objects between two open .mdb files"
thread at all. I tried it on several different computers even...no
luck..not sure why.
I can retrieve lots of message threads from this group, but the one in
question isn't one of them, not sure why.
If you can post the replies in this thread, that would be helpful & I
apologize for making an extra step for you here; not my intention.

Thanks.
Try looking here:

http://groups.google.ca/group/comp.d...0c650a706c2dd5

..

Jul 30 '07 #9
On Jul 30, 11:01 am, rlntemp-...@yahoo.com wrote:
When you say "App1.mdb calls App2.mdb" - what does that mean exactly?

In App1, there is a button on a form that lunches app2. Yes, they are
in the same folder.
App2 uses some information from App1 that has to get passed in to the
2nd progrma.

After reading the thread (all responses), at a high level 2 options
would be to
1) have App1 write an ASCII text file out in the same folder. When
app2 starts, have it read in variables written to the text file.
2) have a 3rd .mdb file that is linked up to App1 and App2 called
App3Shared.mdb. App1 writes the values to a table in App3Shared.mdb
and when App2 is launched it simply reads the table in App3Shared and
brings in the values at startup.
Maybe you should look at the low-level responses.

Jul 30 '07 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Richards Noah \(IFR LIT MET\) | last post by:
I'm trying to test some cgi php, but do not have access to a webserver (in any way, shape, or form). I've been trying to fudge testing by using the CLI php.exe in the windows distribution. I've...
3
by: Fredrik/Sweden | last post by:
Hi folks ! got this problem... i have a table 'Accounts' in my database, which contains a bunch of users. From the main menu i choose "edit user" and all users in the db are presented in a table....
2
by: Gung Ho | last post by:
I am using ASP to open a text file on the server and I want to pass variables to Javascript. Any suggestions? For example - I have a text file on the server defining a set of pictures. I open...
1
by: Consuelo Guenther | last post by:
Hello, I am having problems with passing variables between pages. I have the following: First asp page has the function: -----------------------------------------------------------------------...
27
by: Oscar | last post by:
I am looking for a way to pass an ADO recordset that has been retrieved in an ASP page to another HTML-page. Is there someone who can provide me with a small sample or a link to see how this is...
12
by: Mal Ice | last post by:
I am creating an initial index.htm page on which I show some disclaimers and introduction information. In the head section I have Javascript which determines the screen resolution of the client....
6
by: Scott Zabolotzky | last post by:
I'm trying to pass a custom object back and forth between forms. This custom object is pulled into the app using an external reference to an assembly DLL that was given to me by a co-worker. A...
2
by: Les Peabody | last post by:
Hello. I'm a rookie ASP VBScripter and am having a difficult time scripting the following scenario: I have an index.asp file that has a multi-line text box and a button of type button. When...
28
by: Skeets | last post by:
i'm passing session and hidden variables between pages. not to mention post values. i'm a little concerned that someone with sufficient knowledge could spoof these vlaues and manipulate the...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.