Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

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

Record Source-Length of SQL Statement

Status
Not open for further replies.

Chrisbi

Technical User
Nov 27, 2002
26
US
I have a form created in 2002 Access to be run on Access 2000 (I set to 2000 file format). Forms runs fine on XP computer but first time I oepn the form on 2000 machine, the record source sql on the form is truncated & form can't run. This is a pretty complicated form pulling data from a number of tables. Is there a limit on lenght of statemen in 2000 but not in 2002? (Row Source set in properties in form, not in vba code).

 
Do you have the actual SQL as the form's record source?

If so you can have the code in a (saved) query & use the query as the record source.

Hope this helps.

Regards
Warwick
 
I will try that approach... I'm still curious though about why sql statement was truncated as I have other complex forms & will need to take this little quirk into consideration...

Many thanks.
 
If you reach "String" variable limitations, you can also split your SQL into three parts:
Code:
Dim SelClause as String, FrmClause as String, WhrClause as String
assign the statement parts to these strings (don't forget a trailing or leading space) and then
Code:
Set rs=CurrentDB.OpenRecordset (SelClause & FrmClause & WhrClause, dbOpenDynaset)
Or however you process the sql...

Regards,
MakeItSO

Andreas Galambos
EDP / Technical Support Specialist
(andreas.galambos@bowneglobal.de)
HP:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top