Link to home
Create AccountLog in
Avatar of kmp410
kmp410

asked on

Transfer Data Between Two Infopath Forms

I am hoping this can be solved quickly and easily.  I have zero programming experience but have been successful in creating a very simple Infopath form and database.  Essentially, the Infopath form is the front-end and the Access db is the back-end where the data gets stored.  

The purpose of my forms/db is to track requests made by employees and the responses they receive.  However, often an employee will get multiple responses to the same request at various points in time.  

Basically, this is where I'm at:
(1) I have two tables in the Access db, one is for information related to requests and the other is for information related to responses to the request;

(2) I have a form created in Infopath that allows the employee to input the information about the request (e.g. the date of the request, the type of request, who the request was made to, etc.), this is the "request form" - when this information is submitted to the Access db, a "Request ID" is assigned via the auto-number feature;

(3) In the "request form" I have created a secondary view that allows the employee to search all existing data in the Access db relating to requests (using a simple query function and repeating table to display the results), when an employee gets a response to a request, the employee can search for all the requests in a particular lot and the results are displayed and sorted by "Request ID";

(4) When the employee finds the request that the response is related to, I have a button that the employee can click on so that the employee can enter the response information (e.g. who responded, when, what their response was, etc.) - when the employee clicks the button I have the rule set up to open an entirely new form. ** I have to have a new form open, rather than just switch views in the request form, because I need to submit this data to an entirely separate table in the Access db.  Infopath only allows for one main data connection to submit information to a database table, and I need two connections, so this was the workaround that I came up with. **

(5) >> This is where I need help << In the second form that opens (the response form) I have a "Request ID" field, I would like the date in the "Request ID" field in the first form (the request form) to copy to the "Request ID" field in the second form (the response form), so that a relationship exists between the request and the response.  Like I said, an employee may get 50 responses to a single request, so we need to be able to later look back and see all the responses that relate to that particular request.

Like I said, I have zero programming experience - I don't think what I'm trying to do is overly ambitious, but it's clearly a bit beyond my capabilities.  If anyone has a non-programmatic solution, I'd welcome any suggestions.  If the solution has to be done through progamming, a detailed response would be unendingly appreciated.  Thank you all for your help!
ASKER CERTIFIED SOLUTION
Avatar of Clay Fox
Clay Fox
Flag of United States of America image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
Avatar of kmp410
kmp410

ASKER

I'll be honest, I appreciate trying to keep the solution free of code, but I've tried to do what you suggested, and just can't seem to get it right. Maybe a snippet of code would be best, if you really don't mind putting it together.  I'm using InfoPath 2007.  And I'm happy to tell you the name of the forms or fields if that helps.  I truly appreciate your assistance.
SOLUTION
Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
Avatar of kmp410

ASKER

One more shot ... I tried the programming and that was a disaster, when all was said and done the script editor said I had 54 errors.  I don't understand how, because I pretty much just copied the code from the link and made the changes that needed to be made so that the code applied to my forms.  So, I guess I'm going to go for a rules based solution.

One thing is that there is no user name.  Everyting is based on a lot number, and any employee can access any request.  This is why I'm trying to create the form/database, because right now every employee essentially keeps his/her own spreadsheet with requests and responses, and no one else can access it to review it or modify it.  I thought that by creating the database and InfoPath form and storing them on our local drive, everybody would be able to view all the outstanding requests and all the responses to the request.  Essentially everying is sorted by a lot number, which in the form I have called "File Number" - so if I want to see all the requests for a particular lot, I can search for all the requests for a particular file number, and this will return all the requests associated with that lot (which are then assigned the "Request ID").

When the new form opens the only two things I want to transfer from the first form (the request form) to the second form (the response form) are the data in the Request ID and File Number fields.  These two identifiers are all that's needed to link requests and responses.  All the other data relating to the request and the data relating to the responses does not need to be transferred in any way.

I'm so sorry but I tried to understand what you were saying about setting up flag fields and settign the flag to true and clearing all the other fields when they're submitted, but just not sure how to make that happen.  This is literally the last step in my process.  I have the two forms set up, I have the search function setup, everything else works - it's just getting these two data elements from the first form to the second form.  If I can do this, the entire project will be complete.  Prior to starting this project, I didn't even know InfoPath existed, so I really am a novice, but this project will work for our company so well, if I can just make this last piece happen.  Is there any way that you can explain in a little more detail how to make the rules work out?

Here's what I did as a first step ...
If in the first form (the request form) I set up two additional fields, I'll call them Flag_Request ID and Flag_File Number.

I'm thinking that the second step should be to make it so that in the first form the value of Flag_Request ID = the value of Request ID, and the value of Flag_File Number = the value of File Number (which I know how to do).  What I don't know is how to make these values "True" as you indicated and to clear the other fields on submit.

I'm sorry to be such a pain!
SOLUTION
Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
Avatar of kmp410

ASKER

This does seem to make the most sense, and I think it will be the easiest to deal with.  The one question I have, and hopefully the last one, is that when I add the second table to the first, it disables the option to submit to the database and I keep getting a message about a many-to-one relationship existing.  Any thoughts on how to correct this?
Avatar of kmp410

ASKER

Please disregard my last comment - the problem seemed to be with the Access database, and I figured it out.  Thank you!  Hopefully that is the last question I have for you!
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.