Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Error number 2176

Status
Not open for further replies.

mulderm

Electrical
Jun 4, 2003
35
NL
Hello,

I have a form with a Combobox and the follow code:

Private Sub Form_Load()

Dim bestand As String
Dim lijst As String
Dim pad As String
pad = "c:\bal"
bestand = Dir(pad & "NN*.xls")
Do Until bestand = ""
lijst = lijst & bestand & ";"
bestand = Dir()
Loop
Me.cmbBestanden.RowSource = lijst
end sub

There are totally 1945 files beginning with NN*.xls.
So far no problem.
Now are the files expand to 2500 files!
And now I get the fault warning from Access:
Error number: 2176
The setting for this property is too long.

And the ComboBox is now empty.
Who can help me with this problem?

Greetings,

mulderm
 
Replies continue below

Recommended for you

Hi mulderm,

I think your string "lijst" is just too long, switch to an array to load your files, then change your combo box RowSource to:

Code:
Me.cmbBestanden.RowSource = Join(lijst, ";")

HTH
Todd
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top