Re: Refer to the first row of the table
- From: "Dirk Goldgar" <dg@xxxxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 17 Aug 2007 10:19:08 -0400
In 76cfeb2317fab@uwe">news:76cfeb2317fab@uwe,
samotek via AccessMonster.com <u15330@uwe> wrote:
Thank you so much indeed ! Your line of code which i think is very
clever, gives me a syntax error and i must have written something
wrong somewhere. Would you have a look :
Syntax error in query expression 'afid >SELECT Min(T.afid) FROM
TblClients1 As T)'
Public Function str()
Dim StrSQL As String
StrSQL = " DELETE * FROM TblClients1 WHERE afid > SELECT Min(T.afid)
FROM TblClients1 As T)"
CurrentDb.Execute StrSQL
End Function
You've left off one of the parentheses I had in my original SQL
statement. Try this:
StrSQL = _
"DELETE * FROM TblClients1 WHERE afid > " & _
"(SELECT Min(T.afid) FROM TblClients1 As T)"
Also, don't name your function "str". There's a VBA function named
"Str", and giving your function the same name will interfere with its
use.
--
Dirk Goldgar, MS Access MVP
www.datagnostics.com
(please reply to the newsgroup)
.
- Follow-Ups:
- Re: Refer to the first row of the table
- From: samotek via AccessMonster.com
- Re: Refer to the first row of the table
- References:
- Refer to the first row of the table
- From: samotek via AccessMonster.com
- Re: Refer to the first row of the table
- From: Dirk Goldgar
- Re: Refer to the first row of the table
- From: samotek via AccessMonster.com
- Re: Refer to the first row of the table
- From: Dirk Goldgar
- Re: Refer to the first row of the table
- From: samotek via AccessMonster.com
- Re: Refer to the first row of the table
- From: Dirk Goldgar
- Re: Refer to the first row of the table
- From: samotek via AccessMonster.com
- Refer to the first row of the table
- Prev by Date: Re: save webdata to text file
- Next by Date: RE: MS Access 2000 VB HELP!
- Previous by thread: Re: Refer to the first row of the table
- Next by thread: Re: Refer to the first row of the table
- Index(es):
Relevant Pages
|