What you basically want to to is recognize whether the form has been saved once before or whether it is new, and based on this fact show/hide buttons. Look into using the IsNew property (see http://msdn.microsoft.com/library/en-us/ipsdk/html/xdproIsNew_HV01021289.asp?frame=true). You can add a helper field to your Main data source (but not to any view, since you won't be showing its value) and set the value of this field in the OnLoad event of the form based on whether the form is new or not by using IsNew. Then you can set conditional formatting on the buttons to show/hide them based on the value of this field. --- S.Y.M. Wong-A-Ton
"mbachu[ at ]gmail.com" wrote:
[Quoted Text] > Hi, > I am new to InfoPath and I developed a survey page which has some > Radio buttons, dropdown list, text boxes, Save&Close and Submit button. > > When I open the form for the first time, I would like to display only > the SUBMIT button which will submit the survey with a predefined file > name(Project name -dropdown box). > > When they open an existing form, I would like to hide the SUBMIT button > and display only the SAVE&CLOSE button. (Since it is displaying both > Submit and Save&Close buttons now, user is selecting one of the buttons > and it is causing the problem) > > I have a drop down list which has the project name. If the user opens > the form for the firsttime, it displays Select... and the user can > select the project name and submit the form and it saves with the > project name. > > When they open exisitng form it displays the project name in the > dropdown list. > > How can hide one of the buttons (Save&Close & Submit) based on this > drop down selection? > >
|