Setting Combo Box Default Value

mikefish

New member
Local time
Today, 15:25
Joined
Jan 30, 2008
Messages
8
Hi all.
Quick Combo Box Question.

I Have a Combo Box [TextforClip] which pulls its options from the Table Feedback with

SELECT [Feedback].[ID1], [Feedback].[Feedback_Text] FROM Feedback;

Which works fine.

Most of the time the option selected is the first one in the list so it would be handy to have this as the default rather than the empty box that appears now.

I tried assigning the Default Value manually by putting ="Text I Want" which appears to work ok, the value appears in the combo box but when i run the mouser over it I get a type mismatch error "The value you entered isnt valid for this field"

Is it possible to assign the 1st record from the table as the default value ?
What syntax do I need to refer to the value from Feedback_Text where ID1="1"

I should also point out that I am using the following on an onclick event for a button to send the text box value to the clipboard and this is working fine.

Private Sub CommandtoClip_Click()

Me.TextforClip.SetFocus
DoCmd.RunCommand acCmdCopy

End Sub

Thanks for any help anyone can give.
 
Mike,

I think you need to set the default value to the bound column value, not what you want to see.
 
Excuse my ignorance, I am new at this,. How do I go about doing that ?
 
Looks like you have two columns in the combo box. I'm also guessing that column one is the bound column and column two is what the user will see (and choose). Say a row has iID1 = "1" and Feedback_Text = "Blue" as an option and you want 'Blue' to appear as the default the you need to have "1" as the default value and not "Blue".

Hope this makes sense...
 

Users who are viewing this thread

Back
Top Bottom