Run-time error '2176' The setting for this property is too long.

D

David Brown

I have a distributed database and two of my users are running across the
following error:
Run-time error '2176' The setting for this property is too long.

They each sent their database to me and I can't reproduce the error. The two
users have Access 2000 and I have Access 2002. The code below populates a
list box based on a selection in another list box. Is there a limit to how
much data that list box can handle? If so, how do I get around that?

Thanks for the help,

David


Private Sub cboSiteID_AfterUpdate()
'populate the patient field based on site ID
Dim MyTempCount As Integer
Dim cnn1 As New ADODB.Connection
Dim cmd1 As New ADODB.Command
Dim SQLString1 As String
Dim rst1 As ADODB.Recordset
Dim MySite As Integer
Dim FirstTime As Integer
MySite = Me.cboSiteID
'Configure the combo box
With Me.cboPatientName
.BoundColumn = 1
.ColumnCount = 5
.ColumnWidths = "0;.5 in;.5 in; .5 in; 0"
End With

'Open a connection to the current project
Set cnn1 = CurrentProject.Connection
'Create query strings (There is new code here for Access 2000)
SQLString1 = "SELECT Pat_Key, Pat_LName, Pat_FName, Pat_ID, Pat_SiteID FROM
qry_ActivePatients WHERE Pat_SiteID = " & MySite & " ORDER BY Pat_LName"
Set cmd1 = New ADODB.Command
With cmd1
.ActiveConnection = cnn1
.CommandText = SQLString1
.Execute
End With
Set rst1 = New ADODB.Recordset
rst1.Open cmd1
'(More new code here for Access 2000)
If Not rst1.EOF Then
Me!cboPatientName.RowSource = rst1.GetString(adClipString, , ";", ";")
Else
Me!cboPatientName.RowSource = vbNullString
End If
Me.cboPatientName.Enabled = True
Me.lblTip.Visible = True
Me.lblTipContent.Visible = True
End Sub
 

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