Typically I just clear the query fields and then put a bogus value in one,
like recordID 0 or something and requery the data connection.
This gives you a blank set of data fields.

Signature
Clay Fox / Microsoft InfoPath MVP
www.InfoPathDev.com / The InfoPath Authority / Downloads, Samples, How-To,
Experts, Forum
> In infopath 2003, is there a code representation for the "New Record " Action
> on a Control button ? I want to execute this action from code. Preferable
[quoted text clipped - 6 lines]
> "New record" button. (In my case, click it once and the fields (in a
> repeating section) dissapear, click it again and they reapear, cleared)
RonL - 22 Feb 2008 19:04 GMT
That is exactly what I have done, but that still requires a click of the new
record button to restore the fields for input. as the query returns nothing,
it blanks the repeating section.
> Typically I just clear the query fields and then put a bogus value in one,
> like recordID 0 or something and requery the data connection.
[quoted text clipped - 11 lines]
> > "New record" button. (In my case, click it once and the fields (in a
> > repeating section) dissapear, click it again and they reapear, cleared)
Clay Fox - 22 Feb 2008 20:25 GMT
On your submit button just add additonal actions which submit main, change
query fields as I described, requery main.
Then you have all of the data fields reset like new.
If you are trying to keep data as a template then you would need to copy the
data to a holding area and then back again.

Signature
Clay Fox / Microsoft InfoPath MVP
www.InfoPathDev.com / The InfoPath Authority / Downloads, Samples, How-To,
Experts, Forum
> That is exactly what I have done, but that still requires a click of the new
> record button to restore the fields for input. as the query returns nothing,
[quoted text clipped - 15 lines]
> > > "New record" button. (In my case, click it once and the fields (in a
> > > repeating section) dissapear, click it again and they reapear, cleared)