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 / May 2008

Tip: Looking for answers? Try searching our database.

Selecting a single field to view on a form

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Leslie Isaacs - 06 May 2008 17:11 GMT
Hello All
I want to allow the user to use a combobox to select one field to view from
the form's underlying table.
The combobox is called [combo0], and in the form's detail section is the
textbox [text0] that I want to display the selected field.
I can do this with a very long Case statement (one Case for each potential
field name selection), like this:
   Case "ver k"
   [Text0].ControlSource = "=[sarah k]"
   Case "ver b"
   [Text0].ControlSource = "=[ver b]"
etc
etc

This works but is obviously very tedious. I'm sure I should be able to use
something like:
   [Text0].ControlSource = "=[combo0]"
but this just keeps displaying the field name in [text0], not the field
value.

Where am I going wrong?

Hope someone can help.
Many thanks
Leslie Isaacs
Douglas J. Steele - 06 May 2008 17:23 GMT
Try

[Text0].ControlSource = "=[" & combo0 & "]"

Signature

Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)

> Hello All
> I want to allow the user to use a combobox to select one field to view
[quoted text clipped - 21 lines]
> Many thanks
> Leslie Isaacs
Leslie Isaacs - 06 May 2008 17:33 GMT
Doug

Brilliant - that works perfectly!!

Many thanks
Les

> Try
>
[quoted text clipped - 25 lines]
>> Many thanks
>> Leslie Isaacs
 
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.