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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need your help in string modification...

Status
Not open for further replies.

sabavno

Programmer
Jul 25, 2002
381
CA
Hi,

I have this problem.
My list has a query as its source code. (For example: Select * from charges where AssetType = "Monitor";)

You've noticed that there is a semi-colon that gets assigned at the end by Access 97 (there is not semi-colon at the end of the query's SQL in Access 2000)

I have a button on the form that sorts the first column

The code under this button is:

sql=List.RowSource

List.RowSourse = sql & " Order By Name"

That is where the problem with semi-colon comes in.

I get the following RowSource:
Select * from charges where AssetType = "Monitor"; Order by Name

How would I get rid of that semi-colon?

Please note that don't want to hardcode the SQL myself instead of using this line sql=List.RowSource.

Thanks.
 
sabavno,

Use the Left function to truncate the sql variable by
one character.

Wayne
 
left(strYadda, len(strYadda) - 1), to be specific. =============
Jeremy Wallace
Designing, Developing, and Deploying Access Databases Since 1995

Take a look at the Developers' section of the site for some helpful fundamentals.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top