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