Link to home
Start Free TrialLog in
Avatar of BobRosas
BobRosas

asked on

Main data connection in InfoPath

I'm new to InfoPath.  I have an existing access form and I'm trying to re-create it in InfoPath. I have 5 tables.  See relationships below. I want the user to be able to pick a company from a drop down field and fill the rest of the form.  Also be able to edit and add.  

Every time I think I'm close I get  the error...
      "InfoPath cannot open a new form.  The form template is not valid." (or a similar message)

and I end up starting over.  I think it's because I had all my fields set to a linked data connection instead of the "Main" one.  Is that correct?  
Ques 1) Should all the fields for all the tables be bound to my "Main" data connection?

Also, I don't know how my 'Main' data connection was initially created (that part I haven't had to redo) but I just renamed Field1, Field2… etc to match my field names and I also just right clicked to add more tables and fields so the structure 'look' matches my linked tables structure.  
Ques2) Is there more that that?  Should I be doing more than that or are they just non linked fields?

Ideally I'd like the 3 tables linked to tblContactData to be sections that but don't show unless they are clicked on.  But once selected it will show existing data and let the user edit or add more and then have the ability to collapse/hide the info again.

tblContactCompany 1 to many tblContactData 1 to many tbContactlJobTypes
                                                         "       "       1 to many tblContactNotes
                                          "       "       1 to many tblPhones
Avatar of Clay Fox
Clay Fox
Flag of United States of America image

You would want to create a new database type form based on the Contact Company table.

When you get to the wizard page that displays the field in the table click on add table.
Select the Contact Data Table. Setup the field relationships. Then add the next table adn so on until you have all of the tabels and fields there.

Then complete the wizard.

Then if your tables have the correct Kays etc you should be able to query and submit these tables.  And they will all be apart of your main data connection.
Avatar of BobRosas
BobRosas

ASKER

Thank you for your response.  I really do appreciate it.  I'm just still trying to figure out the first line of your comment.  Does that mean I need to create a new Data Connection? Because I went ahead and did that.  I went thru the Data Connection wizard and added my tables and links and called it Main. I already had 3 data connections (see attached picture).  Now it looks like all it did was add a 2nd "Main" connection instead of overwriting the first one.  So now Main (Secondary) and EmployerContactsGetInfoPath(Secondary) are essentially the same thing.  The "EmployeContacts..." connection was what I was using and kept getting the error mentiioned in my original post.
DataConnections.jpg
ASKER CERTIFIED SOLUTION
Avatar of Clay Fox
Clay Fox
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Not the answer I was hoping for but I do appreciate your help.  I'll start over and post related questions if needed.