Clear query field in infopath form - InfoPath Dev
in

InfoPath Dev

Clear query field in infopath form

Last post 11-03-2009 05:35 PM by Jimmy. 6 replies.
Page 1 of 1 (7 items)
Sort Posts: Previous Next
  • 11-02-2009 01:50 PM

    • tony01
    • Not Ranked
    • Joined on 11-02-2009
    • Posts 4

    Clear query field in infopath form

     Hi everybody:

    I have a form with two parts:

    First part contains a query field Request No., and the second part contains dataFields from Main data source, Employee Id,

    Employee First Name, Employee Last Name , ... etc.

     

    The FORM:

                                               From Test

                (New Record button)

               Request No.  21_______           (Request Search button)

               Employee Id : ______

               Employee First Name: _________

               Employee Last Name: ___________

     

    Query Field: 

    The form has one query field "ReqNo" from a MAIN data source (MS Access db )

    Below are the query fields from Main data source: 

    -myFields

      -queryFields

        -q:TblAccessCardReq

            :ReqNo

            :EmplId

            . 

    DataFields:

     -myFields

      -DataFields

       -d:TblRequest

            :ReqNo

            :EmplId

            :EmplLastName

            :EmplFirstName

            .

    My Problem:

    When I query the form with a request no. for example 21, I get all the information in the form, It works fine,

    then   I click the "New Record" button to clear the whole form, but the query field request number remains to the value

    that previously I used, in this example I use the value 21. In other words the "New Record" can't clear my query field. 

    How can I clear the query fields in the form with the "New Record" button?

    I am doing something wrong?

    Please Help.

    Thanks a lot.

     

     

     

     

     

     


  • 11-02-2009 01:55 PM In reply to

    Re: Clear query field in infopath form

    Set the query field value to null as the first action in your New Record button?

  • 11-02-2009 02:06 PM In reply to

    • tony01
    • Not Ranked
    • Joined on 11-02-2009
    • Posts 4

    Re: Clear query field in infopath form

     Hi Clayton:

    Thanks for reply, but I added a rule on the New Record button to set the query field Request no. to Null but It doesn't

    accept the null value because the field is a numeric.

    Any other ideas.

     

     

     

     

     

     

  • 11-02-2009 07:20 PM In reply to

    Re: Clear query field in infopath form

    Could you clarify what you mean by "It doesn't accept the null value"?  What precisely is "it?"  You should be able to set any field to blank, even if it's numeric and has the "Cannot be blank" requirement.
    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 11-03-2009 05:26 AM In reply to

    • tony01
    • Not Ranked
    • Joined on 11-02-2009
    • Posts 4

    Re: Clear query field in infopath form

     Hi Jimmy:

    Sorry, I don't know where to put the Null or spaces to clear a query field ( Request no.)

    I have a button "New Record"  and the action of this button is to CLEAR all fields from the form but the query field can't clear.

    if I go to the properties of this button I can't put any rules or spaces or nulls.

    If I change the action of the button for example to "Rules and Custom Code" the button

    Can't work anymore clearing all the fields of the form. So, How can CLEAR all

    the fields of my forms including the query fields, in my case I have just one (Request no.).

     

    Thanks  for your help.

     

     

  • 11-03-2009 10:53 AM In reply to

    • tony01
    • Not Ranked
    • Joined on 11-02-2009
    • Posts 4

    Re: Clear query field in infopath form

     Some one can help with this issue here.

    Infopath is a PAIN.

  • 11-03-2009 05:35 PM In reply to

    Re: Clear query field in infopath form

     I think I have an Idea of how to fix this but I can't find a "Clear all Fields" action on buttons I insert into the form.  I see "Submit" "Refresh" and "Rules and Custom Code." How exactly are you accomplishing this "Clear all Fields" behavior?

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
Page 1 of 1 (7 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.