Article ID: 194026
Article Last Modified on 1/23/2007
253552 WD97: How to Create a Combo Box Containing More Than 25 Items from an Access Database
173707 OFF97: How to Run Sample Code from Knowledge Base Articles
Private Sub UserForm_Initialize()
ComboBox1.ColumnCount = 1
'Load data into ComboBox
ComboBox1.List() = Array("Zero", "One", "Two", "Three")
End Sub
and then close the code window
Private Sub ComboBox1_Change()
ActiveDocument.FormFields("Text1").Result = ComboBox1.Value
End Sub
Close the code window.Private Sub Cmdclose_Click() Unload Me End SubClose the code window. Right-click the CommandButton and click Properties on the shortcut menu. On the Alphabetic tab, rename (Name) to Cmdclose and then rename Caption to Close. Close the CommandButton Properties window.
Sub gocombobox() frmcombo.Show End Sub
Additional query words: vba
Keywords: kbdtacode kbfield kbforms kbhowto kbmacroexample KB194026