Results 1 to 5 of 5
  1. #1
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 10 Access 2013 32bit
    Join Date
    Feb 2011
    Posts
    2,095

    SQL SELECT * syntax error(s)

    What seemed simple at the outset keeps giving errors.

    THE SUBS CODE:
    Code:
    Public Sub SetF2F8(DteValue As Long)
    '*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
    ' We need to update the date fields in the date columns in table tblMenuSheet
    '*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
    Dim strSQL As String
    Dim rs As DAO.Recordset
    
    
    On Error GoTo ErrHandler
    
    
    strSQL = "SELECT * From [tblMenuSheet] WERE [MenuID] = " & intDateRow     'intDateRow from Settings, global to this module
    Set rs = DBEngine(0)(0).OpenRecordset(strSQL)
    
    
    '#### SNIP ####
    
    
    rs.Close
    Set rs = Nothing
    
    
    Exit_ErrHandler:
        Exit Sub
        
    ErrHandler:
        MsgBox "Error " & Err.Number & " in SetF2F8 Sub : " & Err.Description, vbOKOnly + vbCritical
        MsgBox strSQL       'Let me see what the beef is?
        Resume Exit_ErrHandler
    End Sub
    THE ERRORS:
    Click image for larger version. 

Name:	Err01.jpg 
Views:	13 
Size:	17.1 KB 
ID:	52883
    Click image for larger version. 

Name:	Err02.jpg 
Views:	13 
Size:	17.3 KB 
ID:	52884

  2. #2
    Edgar is offline Competent Performer
    Windows 8 Access 2016
    Join Date
    Dec 2022
    Posts
    309
    You wrote WERE and it's WHERE.
    Please click on the ⭐ below if this post helped you.


  3. #3
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    6,555
    Need to go to Specsavers.
    As mentioned WERE not WHERE ! :-)
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  4. #4
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 10 Access 2013 32bit
    Join Date
    Feb 2011
    Posts
    2,095
    GOOD GRIEF! (You'll understand this caper better when you reach 90 years-old)
    Thanks,
    The "Old Geezer"

  5. #5
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    6,555
    I am getting there.
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 15
    Last Post: 03-01-2021, 12:07 PM
  2. Replies: 5
    Last Post: 09-16-2018, 01:18 PM
  3. Convert SQL Server Syntax To Access Query Syntax
    By chalupabatman in forum Queries
    Replies: 1
    Last Post: 10-18-2017, 08:53 PM
  4. Replies: 14
    Last Post: 07-07-2015, 07:39 PM
  5. Incomplete Syntax Clause (syntax error)
    By ajetrumpet in forum Programming
    Replies: 4
    Last Post: 09-11-2010, 10:47 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums