Please try to replace the Query Button with a common button, add the rule to
it, at last add a "Query using a data connection" action to the rule.
http://www.infojetsoft.com, InfoJet Service, a product likes InfoPath Forms
Services.
>I have a Run Query Button in InfoPath, but I can't find anywhere that I can
> add a rule to it. Can it be done and if so, how?
>
> Thanks,
>
> MEG
Meg - 08 Mar 2007 20:04 GMT
Is there a way to clear the form (make it blank) after running the Query?
> Please try to replace the Query Button with a common button, add the rule to
> it, at last add a "Query using a data connection" action to the rule.
[quoted text clipped - 8 lines]
> >
> > MEG
Zhang Haiguang - 09 Mar 2007 04:06 GMT
Sorry, I don't know. Maybe you could clear the fields in "Set a field's
value" action one by one...
> Is there a way to clear the form (make it blank) after running the Query?
>
[quoted text clipped - 13 lines]
>> >
>> > MEG
Meg - 09 Mar 2007 18:36 GMT
Thanks, I did try that but it still never gave me the results I wanted.
Maybe someone else out their knows.
It did clear the fields but, I have 2 views 1 is for data entry and 1 is for
search and edit. When I search for a record by name I get all the records
for that person which I want but when I want to complete a new record I
switch to the Data Entry View and it still has all the search records and I
want 1 blank form for them to enter another record.
Maybe I am asking too much.
MEG
> Sorry, I don't know. Maybe you could clear the fields in "Set a field's
> value" action one by one...
[quoted text clipped - 16 lines]
> >> >
> >> > MEG
Zhang Haiguang - 10 Mar 2007 13:48 GMT
Please try to use codes to clear the query field and query result fields, as
the following InfoPath 2003 managed code:
[InfoPathEventHandler(EventType=InfoPathEventType.OnSwitchView)]
public void OnSwitchView(DocEvent e)
{
// Write your code here.
DOMNode idNode = thisXDocument.DOM.selectNodes(
"/dfs:myFields/dfs:queryFields/q:Employees/@EmployeeID" );
idNode.nodeValue = ""
if( thisXDocument.View.Name.Equals( "View 1" ) )
{
DOMNodeList nodeList = thisXDocument.DOM.selectNodes(
"/dfs:myFields/dfs:dataFields/d:Employees" );
foreach( DOMNode node in nodeList )
{
node.parentNode.removeChild(node);
}
}
}
InfoPath Web Form [http://www.infojetsoft.com]
> Thanks, I did try that but it still never gave me the results I wanted.
> Maybe someone else out their knows.
[quoted text clipped - 34 lines]
>> >> >
>> >> > MEG
Zhang Haiguang - 10 Mar 2007 14:10 GMT
Oh, it should be:
[InfoPathEventHandler(EventType=InfoPathEventType.OnSwitchView)]
public void OnSwitchView(DocEvent e)
{
// Write your code here.
if( thisXDocument.View.Name.Equals( "View 1" ) )
{
DOMNode idNode = thisXDocument.DOM.selectNodes(
"/dfs:myFields/dfs:queryFields/q:Employees/@EmployeeID" );
idNode.nodeValue = ""
DOMNodeList nodeList = thisXDocument.DOM.selectNodes(
"/dfs:myFields/dfs:dataFields/d:Employees" );
foreach( DOMNode node in nodeList )
{
node.parentNode.removeChild(node);
}
}
}
> Please try to use codes to clear the query field and query result fields,
> as the following InfoPath 2003 managed code:
[quoted text clipped - 56 lines]
>>> >> >
>>> >> > MEG
Meg - 13 Mar 2007 13:05 GMT
Thank you so much, I have not tried this yet (I am going to try today) but I
believe it is going to work.
I have 1 more question:
After I do the above, I am going to publish my form to another location. I
have already published it to our network drive here in my office. However, I
have mapped to another drive located in another State. I have put an
identical Database on their drive (all the tables are the same except
different employee names)
Can I publish my same form to their location so that when I update my form
here it will update theirs or do I have to save my form on their drive too
and then publish it from there?
A quick response would be greatly appreciated as they are waiting on my form.
Thanks,
MEG
> Oh, it should be:
> [InfoPathEventHandler(EventType=InfoPathEventType.OnSwitchView)]
[quoted text clipped - 75 lines]
> >>> >> >
> >>> >> > MEG