Unbound combo box on form

B

bg_ie

Hi,

I have a form whos record source is a table called tblTest. I wish to
have a comboBox whos row source is -

SELECT tblTest.TestID, tblTest.TestName FROM tblTest

where the values displayed in the combo are those of the second column
(tblTest.TestName).

The idea of this combo is that I can jump to a particular row, based
on TestName, rather than simply stepping to it via the next and
previous buttons in the footer.

The problem is that this combo is unbound (control source is null).
Therefore when I open the form the combo is blank, but also when I use
the next and previous buttons in the footer, the combo is not
updated.

How might I fix this? I tried setting the control source to
tblTest.TestID, but I get the message -"Control can't be changed as it
is bound to tblTest.TestName".

What should I do?

Thanks,

Barry.
 
S

Scott McDaniel

Hi,

I have a form whos record source is a table called tblTest. I wish to
have a comboBox whos row source is -

SELECT tblTest.TestID, tblTest.TestName FROM tblTest

where the values displayed in the combo are those of the second column
(tblTest.TestName).

The idea of this combo is that I can jump to a particular row, based
on TestName, rather than simply stepping to it via the next and
previous buttons in the footer.

The problem is that this combo is unbound (control source is null).
Therefore when I open the form the combo is blank, but also when I use
the next and previous buttons in the footer, the combo is not
updated.

This is expected behavior with an Unbound control. What data should the combo show when you move from record to record?
If you want, you can update the combo in the Form's Current event:

Sub Form_Current()
Me.YourCombo = Me.TestID
End Sub


Scott McDaniel
scott@takemeout_infotrakker.com
www.infotrakker.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top