Re: Refer to the first row of the table



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)


.



Relevant Pages

  • Re: How to define the assignment operator in Ruby ?
    ... :16: syntax error, unexpected kEND, expecting $end from:16 ... the default clone and dup methods perform ... attr_accessor:str ...
    (comp.lang.ruby)
  • Re: datatable.compute
    ... I am getting a Syntax error in the compute method of a datatable. ... SUM the qty field based on a ... filter expression and the expression contains 3 fields. ... TotalPickQty = Convert.ToInt32", str)) ...
    (microsoft.public.dotnet.framework.compactframework)
  • Re: Refer to the first row of the table
    ... clever, gives me a syntax error and i must have written something ... You've left off one of the parentheses I had in my original SQL ... don't name your function "str". ...
    (microsoft.public.access.modulesdaovba)
  • Questions about subclassing an int
    ... def addStr(self, str): ... It works ok with S but it fails when I try to instantiate T with a syntax error. ... Time flies like the wind. ... Stranger things have .0. ...
    (comp.lang.python)

Quantcast