Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms Programming / April 2005

Tip: Looking for answers? Try searching our database.

AddItem

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Andre Skeen - 20 Apr 2005 14:03 GMT
Hi
I am trying to add a hidden field to a combo box, and am unable to get more
than 1 field to add/display.

The code is comboboxname.additem (value)

Can anyone tell me how to add the second field?
Signature

Andre Skeen

Graham R Seach - 20 Apr 2005 14:23 GMT
Andre,

You can't use the AddItem method. It's a "feature"!

How you add a column depends on where the combo gets its data from. If it
gets its data from a query, you need to add a column to the query. If it
gets its data directly from a table, you need to use a query to which you've
added an extra column.

If the combo gets its data from the RowSource property (when the
RowSourceType property is set to "Value List"), you need to add the hidden
column to the end of the string in the RowSource property, preceded by a
semi-colon. For example, if the RowSource property is like so:
   "ABC"; "DEF"; "GHI"
...then you add the new column like so:
   "ABC"; "DEF"; "GHI"; "JKL"

In all cases, you must increment the ColumnCount property to account for the
added column, and add a column width of zero to the ColumnWidths property.
For example, if our ColumnWidths property is like so:
   0cm;2.5cm;3cm
...then you add the new column and make it "hidden", like so:
   0cm;2.5cm;3cm; 0cm

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia
---------------------------

> Hi
> I am trying to add a hidden field to a combo box, and am unable to get
[quoted text clipped - 4 lines]
>
> Can anyone tell me how to add the second field?
 
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.