<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://www.infopathdev.com:443/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Newbie Questions</title><link>https://www.infopathdev.com:443/forums/39.aspx</link><description>New to InfoPath? Search to see if your question has already been answered. If it has not, then ask it here or the appropriate topic forum.</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: Primary key being retained after new record button pushed</title><link>https://www.infopathdev.com:443/forums/thread/40798.aspx</link><pubDate>Tue, 21 Apr 2009 15:21:26 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:40798</guid><dc:creator>kminor</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/40798.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=40798</wfw:commentRss><description>&lt;p&gt;I figured out a solution to my problem.&amp;nbsp; In case anyone else runs into a similar issue, here is what I did:&lt;/p&gt;
&lt;p&gt;I created a query in my Access database that pulls the max value of my request ID, plus one.&amp;nbsp; I added that as a secondary data source.&amp;nbsp; On my submit button, I added a rule that runs a query (that secondary data source I just set up), then sets the request ID field&amp;#39;s value to that value.&lt;/p&gt;
&lt;p&gt;After doing that, I was STILL getting the primary key violation error on submit.&amp;nbsp; I set up an autonumber on the Access table to use as the primary key, instead (just for testing), and allowed duplicate entries on my request ID field.&amp;nbsp; STILL gave the PK violation.&amp;nbsp; This time I knew something fishy was going on.&amp;nbsp; I revisited my main data connection and modified it (went through the motions, didn&amp;#39;t change anything, clicked submit).&amp;nbsp; I noticed on the summary screen that it said submit was disabled due to a possible many-to-one relationship.&amp;nbsp; I had a state abbreviation/name lookup table included in the main data connection as well.&amp;nbsp; I realized I didn&amp;#39;t need that table after all, deleted it, and all has been working fine ever since!&lt;/p&gt;
&lt;p&gt;Long story short:&amp;nbsp; I think all would&amp;#39;ve worked fine if I&amp;#39;d kept the request ID field as an autonumber and just removed the extra table from my main datasource.&amp;nbsp; Still, I&amp;#39;m not a huge fan of autonumbers, and this solution is nice because I can use the request ID in the e-mail submission.&amp;nbsp; If it was still an autonumber, the ID wouldn&amp;#39;t be created until the form was submitted to the database.&lt;/p&gt;</description></item><item><title>Re: Primary key being retained after new record button pushed</title><link>https://www.infopathdev.com:443/forums/thread/40761.aspx</link><pubDate>Mon, 20 Apr 2009 19:08:08 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:40761</guid><dc:creator>kminor</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/40761.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=40761</wfw:commentRss><description>&lt;p&gt;Can anyone help with this, please?&amp;nbsp; I&amp;#39;m really, really stuck.&lt;/p&gt;</description></item><item><title>Primary key being retained after new record button pushed</title><link>https://www.infopathdev.com:443/forums/thread/40595.aspx</link><pubDate>Tue, 14 Apr 2009 15:54:04 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:40595</guid><dc:creator>kminor</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/40595.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=40595</wfw:commentRss><description>&lt;p&gt;I have a new record button on a request form that I created.&amp;nbsp; If a user queries for an existing form (let&amp;#39;s say it has a request ID of 15), then presses the new record button, then fills out and submits the form -- the new record is submitted to my Access database with the old request ID even though the request ID field is blank.&amp;nbsp; This causes a primary key violation.&amp;nbsp; Is there a way around this?&amp;nbsp; Thanks for your help.&lt;/p&gt;
&lt;p&gt;ETA -- I&amp;#39;m trying to work around this by querying the access DB for a new request ID when the form is submitted.&amp;nbsp; Is this the way to go?&lt;/p&gt;</description></item></channel></rss>