Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #6  
Old 09-13-2012, 05:23 PM
macropod's Avatar
macropod macropod is offline Dropdown selection value Windows 7 64bit Dropdown selection value Office 2010 32bit
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

With your initialisation, you could add the values, so:
Code:
Private Sub UserForm_Initialize()
cmbCat.AddItem "HHP"                    'ListIndex = 0
cmbCat.Column(1, 0) = 1234
cmbCat.AddItem "Demographics"           'ListIndex = 1
cmbCat.Column(1, 1) = 2345
cmbCat.AddItem "Immunization"           'ListIndex = 2
cmbCat.Column(1, 2) = 3456
cmbCat.AddItem "History and Physical"   'ListIndex = 3
cmbCat.Column(1, 3) = 4567
cmbCat.AddItem "Progress Note"          'ListIndex = 4
cmbCat.Column(1, 4) = 5678
cmbCat.AddItem "Labs"                   'ListIndex = 5
cmbCat.Column(1, 5) = 6789
cmbCat.AddItem "Xray"                   'ListIndex = 6
cmbCat.Column(1, 6) = 7890
cmbCat.AddItem "EKG"                    'ListIndex = 7
cmbCat.Column(1, 7) = 8901
cmbCat.AddItem "Physician Orders"       'ListIndex = 8
cmbCat.Column(1, 8) = 9012
cmbCat.AddItem "Consults"               'ListIndex = 9
cmbCat.Column(1, 9) = 2468
cmbCat.AddItem "Misc"                   'ListIndex = 10
cmbCat.Column(1, 10) = 4810
cmbCat.AddItem "RX"                     'ListIndex = 11
cmbCat.Column(1, 11) = 1012
cmbCat.AddItem "Encounters"             'ListIndex = 12
cmbCat.Column(1, 12) = 1248
cmbCat.AddItem "HHP"                    'ListIndex = 13
cmbCat.Column(1, 13) = 1357
'Using drop down list
cmbCat.Style = fmStyleDropDownList
' ComboBox valuers are List Index Values
cmbCat.BoundColumn = 0
' setting cmbCat to first entry
cmbCat.ListIndex = 0
End Sub
Then, with your 'cmdOK_Click' sub, you can call these via:
vCat = UserForm1.cmbCat.Column(1)

Do note that, in many barcoding systems (eg code 128), you can't simply take an alpha/numeric string and apply the barcode font to it - you must first transform the entire string via a compression code and it's the compressed code that gets barcoded. Accordingly, outputting each variable into separate formfields won't work for such systems. It may be OK for Code 3of9, though, but even that requires asterisks at each end.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
 

Tags
combo box, dropdown, forms, vba



Similar Threads
Thread Thread Starter Forum Replies Last Post
add values to dropdown selections and calculate guyhs Word 7 10-24-2012 05:11 PM
Dropdown selection value Autofill a form which is contingent on a dropdown selection. biffle0764 Word 2 05-09-2012 12:54 PM
Macro to populate a text form field based on dropdown selection koloa Word 0 10-20-2011 11:52 AM
Automatic find replace after selection in dropdown vsempoux Word 0 10-28-2009 08:45 AM
Validating Dropdown box dammad83 Word VBA 0 03-01-2006 12:40 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 06:48 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