Need to switch to a view with blank fields to enter a new record - InfoPath Dev
in

InfoPath Dev

Need to switch to a view with blank fields to enter a new record

Last post 03-11-2009 07:39 AM by Joemanc. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 10-09-2008 12:31 PM

    Need to switch to a view with blank fields to enter a new record

    Here's what I have so far:

    I have 1 view that I run a query with, the results appear in a repeating table below the query with only 4 fields showing and a button to swith to the full details for that record which is another view.

    I have a button that I want to use to open another view with all the fields blank so that the user can enter new data.

    Here's what happens right now:  if I go to the Add New view first it works ok.  If I run any query, then try to go to the Add New view, the Add New view opens with all the data from the query, one item after another.  I tried assigning a rule on the button to give one of the query fields a value and then run a new query where I know there will not a result, but then the fields don't show up on the Add New view.  I tried using the New Record button, but that takes me away from the Add New view.

    I hope this makes sense to someone, as I haven't been able to get this to work.

    Thanks for anyone's help with this.

  • 10-16-2008 12:54 AM In reply to

    • ravig
    • Top 500 Contributor
    • Joined on 06-21-2008
    • Posts 27

    Re: Need to switch to a view with blank fields to enter a new record

    Add a reference field to schema, set this field value to 1 if you click on full details button and set to 0 if you click on new form button. Populate the fields with query values if the reference field value is 1 otherwise make the fields blank.


    OR


    You can add another view and display this view when you click on New Form button.

    Ravi G
  • 02-05-2009 02:07 AM In reply to

    Re: Need to switch to a view with blank fields to enter a new record

    Can u provide some code for doing this? I mean for adding "switch on another new after clicking a New Record button"?.
  • 03-11-2009 07:39 AM In reply to

    Re: Need to switch to a view with blank fields to enter a new record

    This is what I did for my solution and it works great!

    Create 4 views in your form: 1 for a Main Menu, 1 for the Query View, 1 for the Data View and 1 for the New Record View.

    Set your New Record View as the Default form.

    Go to Tools, Form Options and under Open Behavior, create a rule that switches view to Startup view.

    On your startup view, add a button for Searching. Clicking this button will take you to the Query Screen, and eventually the Data Screen once you run the query.

    Go back to the startup view, add a button for entering a New Record. Behind this button, set the Action to New Record. Because we set the New Record View as the Default Form, not only do we clear out the Data Fields, BUT, we also switch over to the New Records view. This is a great trick and workaround!

    Hope this helps everyone out!

    Joe

Page 1 of 1 (4 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.