> Hi there,
> John Blessing.....you are a blessing (no pun intended). That did the
trick.
> Thank you very much for your help!!!
> > > Visual Basic 6
> > > Access 2000
> > > I am tring to execute the following SQL statement and getting this
> syntax
> > > error. I receive the following message:
> > > Run-time error '-2147217900(80040e14)'
> > > Syntax Error (Missing operator) in query expression
> > > Here is my code:
> > > strSQL = "Select MAX[ID_NUMBER] from READERS"
> > > With rsReaderID
> > > .CursorLocation = adUseClient
> > > .Open strSQL, conUREAD1, , , adCmdText
> > > strIDNumber = ![ID_NUMBER]
> > > End With
> > > Can someone please point out exactly what is missing. I checked a
> number
> > of
> > > places but can't see a definitive solution.
> > > Thanks
> > I think the problem is you are using [] instead of () in the MAX, so it
> > should be
> > strSQL = "Select MAX(ID_NUMBER) from READERS"
> > > strIDNumber = ![ID_NUMBER]
> > Never seen this syntax before. Normally:
> > strIdNumber = .fields (0)
> > Notice I have specified the field using an index number as I don't think
> you
> > can guarantee what name the database will give the retrieved column
unless
> > you specify it in your query, e.g.:
> > strSQL = "Select MAX(ID_NUMBER) as max_id from READERS"
> > In which case you could:
> > strIdNumber = .fields ("max_id")
> > --
> > John Blessing
> > http://www.LbeHelpdesk.com - Help Desk software at affordable prices
> > http://www.free-helpdesk.com - Completely free help desk software !
> > http://www.lbetoolbox.com - Remove Duplicates from MS Outlook
> > http://www.lbesync.com - Synchronize two Outlook Personal Folders