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 / September 2005

Tip: Looking for answers? Try searching our database.

Setting Default value for Dropdown List

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Rohit - 20 May 2005 19:50 GMT
Hi,

I populate my Drop-down list box with a XML file. How do set a default value?

Thanks,
Rohit
Greg Collins [InfoPath MVP] - 20 May 2005 20:05 GMT
You set the default value in the node which the drop-down list is bound to.

So let's say you have a field named "MyDDListValue" with a drop-down list box bound to it. The drop-down list is populated from an XML file. If you set a default value on MyDDListValue, then if that default value appears inthe XML file, it will be the default selected value.

Signature

Greg Collins [InfoPath MVP]
Please visit: http://www.InfoPathDev.com

Hi,

I populate my Drop-down list box with a XML file. How do set a default value?

Thanks,
Rohit
Scott L. Heim [MSFT] - 20 May 2005 20:20 GMT
Hi Rohit,

Or you can do it the easy way...which is what Greg suggested! :-)

Simply right-click on the node in your data source that the drop-down list
is bound to, choose Properties and then enter the default value.

Sorry I didn't include this....

Best Regards,

Scott L. Heim
Microsoft Developer Support

This posting is provided "AS IS" with no warranties, and confers no rights
Rohit - 20 May 2005 21:05 GMT
Thanks Greg. Thanks Scott. That worked!

> Hi Rohit,
>
[quoted text clipped - 11 lines]
>
> This posting is provided "AS IS" with no warranties, and confers no rights
Scott L. Heim [MSFT] - 20 May 2005 20:12 GMT
Hi Rohit,

You can add a Rule that gets applied when the form is opened:

1) Open your InfoPath solution in Design View
2) From the Tools menu, choose Form Options and then select the Open and
Save tab
3) Click the Rules button
4) Click Add
5) Click Add Action
6) Choose Set a Field's Value form the Action drop-down list
7) Click the "builder" button next to Field and select your drop-down list
8) In the Value field, enter the value you want to be the default (Note:
this must match what is being "stored" in this list - not necessarily what
is being "displayed")
9) Click OK until you are back to your form
10) Test!

Each time a new form is created from your XSN, your drop-down list will now
reflect the default you specified.

I hope this helps!

Best Regards,

Scott L. Heim
Microsoft Developer Support

This posting is provided "AS IS" with no warranties, and confers no rights
Weisen - 29 Sep 2005 20:54 GMT
Weisen Thanks Scott.

Your answer is helpful and half what I want.

I bound Dropdown List Box to Access database directly and set the field is
mandatory that means not blank. After seting value as "Select Department",  
the default display of the field is "Select Department" that is what I want.
The problem is that you can let the "Select Department" as a name of
department without selection, and the validation does not tell you this field
is blank or not.

Any suggestion is much appreciated.

Thanks again for you suggestion!

Weisen
gaoweisen@hotmail.com

> Hi Rohit,
>
[quoted text clipped - 25 lines]
>
> This posting is provided "AS IS" with no warranties, and confers no rights

Rate this thread:






 
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.