Brett Walker
Brett Walker

Reputation: 3576

Access: run-time error '2176' - The setting for this property is too long, but it is not

I'm not an experienced vba programmer and working with access is not my cup of tea. I've been asked to fix some errors in an MS Access 2010 VB application.

I have the following line of code which throws run-time error '2176' - The setting for this property is too long.

grdDocs.RowSourceType = "SELECT tblLicenceDocuments.lDocumentId, " & _
                                "tblLicenceDocuments.sTitle as Title, " & _
                                """"" as Type, " & _
                                """"" as Method, " & _
                                "tblLicenceDocuments.sAvailabilityDetails as Availability, " & _
                                """"" as Format " & _
                        "FROM tblLicenceDocuments " & _
                        "WHERE tblLicenceDocuments.lLicenceId =  1187 " & _
                        "ORDER BY tblLicenceDocuments.sTitle"

The sql in question is only 279 characters in length, so the length is not a problem (I could be wrong). I have run the sql and it is valid. I have searched the web with no good leads.

Any suggestions will be appreciated.

Upvotes: 1

Views: 2080

Answers (1)

Brett Walker
Brett Walker

Reputation: 3576

I meant to set .RowSource, not .RowSourceType; As Tim Williams so dutifully pointed out.

Upvotes: 1

Related Questions