Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 05-05-2011, 06:47 PM
macropod's Avatar
macropod macropod is offline How to unlock Drop-Down list Windows 7 32bit How to unlock Drop-Down list Office 2007
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Hi Ikks,

Dropdown formfields don’t support text entry. To provide that facility, you could provide an option in the dropdown for 'free text' and use an on-exit macro with an Inputbox to insert the user’s 'free text' into the dropdown. For example, suppose you have a dropdown with 5 items, the last of which offers free text entry (e.g. an 'Other' option). Adding the following on-exit macro to the formfield will provide that:
Code:
Sub FreeText()
Dim StrNew As String, i As Long
With Selection.FormFields(1).DropDown
  i = .ListEntries.Count
  If .Value = i Then
    StrNew = Trim(InputBox("Input your text", "Data Entry", .ListEntries(i).Name))
    If StrNew = vbNullString Then Exit Sub
      .ListEntries(i).Delete
      .ListEntries.Add StrNew
      .Value = i
  End If
End With
End Sub
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
 

Tags
drop-down list unlock



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to unlock Drop-Down list Conditional data validation (list drop-down) click4akshay Excel 2 04-28-2011 01:51 PM
Adding a country drop-down list iyavor Word 0 10-27-2010 03:51 AM
Create Drop Down List Box hbradshaw Word VBA 0 09-27-2010 06:24 AM
Drop Down List and Functions (Linking) sten Excel 0 03-17-2010 03:03 PM
Long List for drop down box DLo99 Word 0 02-28-2010 08:07 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 01:30 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft