Combobox not displaying values

S

Scott Simonson

I have a form and I am trying to show the values from a table but also
trying to add an additional value. When I activate the form and then click
the dropdown arrow no values show. Here is what I got for code:

Private Sub Form_Open(Cancel As Integer)
On Error GoTo FormOpenError

Dim rsCutType As Recordset
Dim strCutTypeList As String

Caption = "Cut Type"
lblPrompt.Caption = "Select Cut Type"

Set rsCutType = CurrentDb.OpenRecordset("SELECT * FROM tblCutType")

Do While Not rsCutType.EOF
strCutTypeList = strCutTypeList & rsCutType.Fields!CutType & ";"
rsCutType.MoveNext
Loop
strCutTypeList = "All Cut Types;" & strCutTypeList

strCutTypeList = Left$(strCutTypeList, Len(strCutTypeList) - 1)

cbCutType.RowSourceType = "Value List"
cbCutType.RowSource = strCutTypeList
cbCutType.Requery
Refresh
cbCutType.Value = "All Cut Types"

FormOpenExit:
Exit Sub

FormOpenError:
MsgBox Err.Description
Cancel = True
GoTo FormOpenExit

End Sub


How do I show the values?

Thanks,

Scott
 
S

Scott Simonson

Arrrggg, forgive me I found it to be that the Column widths were messed up
because originally it was a two column list. I particially changed it to 1
column and the original setting was to hide the first column. Simply
emptying this property fixed the problem. That's what happens when I give up
so easily.

Sorry,

Scott
 

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