Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / General MS InfoPath Questions / February 2008

Tip: Looking for answers? Try searching our database.

Is there code for "New Record" Action ?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
RonL - 22 Feb 2008 17:37 GMT
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
Javascript.
When executing this action from a button, it clears all fields and resets
the form. So after a Submit of the main database connection, any changes in
the form and resubmission results in a modification of the data instead of a
new addition.
I need to be able to reset the form without the user having to click the
"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 18:30 GMT
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)
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.