SQL won't work

rschultz

Registered User.
Local time
Today, 07:22
Joined
Apr 25, 2001
Messages
96
I have the following SQL statement, but when I click the button it's on I get an error saying I need an SQL statement to use RunSQL. What's wrong with the SQL I have? How do I put the table in order byt that field?

Dim STRField As String
STRField = "SELECT * " & _
"FROM [APS Import Test] " & _
"ORDER BY [APS Import Test].[Serv Acct ];"
Docmd.RunSQL (STRField)
 
>>are you trying to view/update data via a form
no, I was trying to order the table by a field. I went into the table, clicked on the field title, then clicked on the down arrow icon up on the menu bar. When I'm through tweaking the table I imported from a spreadsheet, I import it into the main table and then delete the temporary table. I have to do that each month. Now, somehow, since I manually did that, each time I import the table from a spreadsheet it's in that order again so I guess I don't need to do it each time, but I don't knwo why that would be since it's a new table each time. I just thought if it could be done manually by clicking the icon I should be able to do it with code.
 

Users who are viewing this thread

Back
Top Bottom