How to Publish to 2 locations (offices) using the same form

M

Meg

I want to publish my form to 3 or 4 offices. I
have already published it to our network drive here in my office and it
works fine. Each Office has an identical Database in Access (which are blank
to start with, except for the lists I am using for the drop down lists) This
database is located the same place on those office's server as mine. I need
for each office to be have separate databases as they have different
employees.

I want to use the same form as I am using here because I don't want to
recreate another form for each Access Database. Can I publish my same form
to their locations. or a save as form to their locations.

Can someone help please. I have tried everything that I know (which is not
a lot).

Thanks,

MEG
 
Z

Zhang Haiguang

Hi Meg,

Maybe you could write some codes in the OnLoad event:
function XDocument::OnLoad(eventObj)
{
if( user is one of depart1 ){
XDocument.QueryAdapter.Connection = "connection for depart1
database";
}else if( user is one of depart2 ){
XDocument.QueryAdapter.Connection = "connection for depart2
database";
}
}

Of course, you should can get the department of the current user...

InfoJet Service
InfoPath Web Form
[http://www.infojetsoft.com]
 
M

Meg

WOW! I am not sure I know how to do this, but if you could point me to how I
actually get to the OnLoad Event, I will try. Basically the only coding I
have done is on the OnClick Event and only a couple lines. I don't suppose
there is a simpler way?? Or at least help some more with the code. for
example, the file I think I would refer to is Office_Name_ID in my access
database. or am I way off base?

Thanks,

MEG
 
Z

Zhang Haiguang

For the OnLoad Event, please click the menu Tools -> Programming-> On Load
Event ...
In my solution, you must know the deparment of the current user running the
current InfoPath form first, then you can switch the connection.
Only you know how to get it...

Or, if you allow user to switch the connection by themself( such as made the
selection on a dropdown box ), the thing will be easy.
Sorry, I don't know the simpler way...

Meg said:
WOW! I am not sure I know how to do this, but if you could point me to
how I
actually get to the OnLoad Event, I will try. Basically the only coding I
have done is on the OnClick Event and only a couple lines. I don't
suppose
there is a simpler way?? Or at least help some more with the code. for
example, the file I think I would refer to is Office_Name_ID in my access
database. or am I way off base?

Thanks,

MEG

Zhang Haiguang said:
Hi Meg,

Maybe you could write some codes in the OnLoad event:
function XDocument::OnLoad(eventObj)
{
if( user is one of depart1 ){
XDocument.QueryAdapter.Connection = "connection for depart1
database";
}else if( user is one of depart2 ){
XDocument.QueryAdapter.Connection = "connection for depart2
database";
}
}

Of course, you should can get the department of the current user...

InfoJet Service
InfoPath Web Form
[http://www.infojetsoft.com]
 
M

Meg

Thanks very much. You are awesome! Now that you told me where to find the
On Load Event I think I can at least attempt putting the code in it and maybe
even get it to work. I never even thought to look under a menu option.

thanks again!

MEG

Zhang Haiguang said:
For the OnLoad Event, please click the menu Tools -> Programming-> On Load
Event ...
In my solution, you must know the deparment of the current user running the
current InfoPath form first, then you can switch the connection.
Only you know how to get it...

Or, if you allow user to switch the connection by themself( such as made the
selection on a dropdown box ), the thing will be easy.
Sorry, I don't know the simpler way...

Meg said:
WOW! I am not sure I know how to do this, but if you could point me to
how I
actually get to the OnLoad Event, I will try. Basically the only coding I
have done is on the OnClick Event and only a couple lines. I don't
suppose
there is a simpler way?? Or at least help some more with the code. for
example, the file I think I would refer to is Office_Name_ID in my access
database. or am I way off base?

Thanks,

MEG

Zhang Haiguang said:
Hi Meg,

Maybe you could write some codes in the OnLoad event:
function XDocument::OnLoad(eventObj)
{
if( user is one of depart1 ){
XDocument.QueryAdapter.Connection = "connection for depart1
database";
}else if( user is one of depart2 ){
XDocument.QueryAdapter.Connection = "connection for depart2
database";
}
}

Of course, you should can get the department of the current user...

InfoJet Service
InfoPath Web Form
[http://www.infojetsoft.com]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top