Results 1 to 5 of 5
  1. #1
    bishmedia is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    May 2018
    Posts
    44

    Error Setting up Query

    Ive built a query based on a table, code is


    Code:
    SELECT Freespace.[ID], Freespace.[Date], Freespace.[Aisle], Freespace.[Quantity], Freespace.[LFIE], Freespace.[LEIF], Freespace.[CountError], Freespace.[EndAccuracy], Freespace.[WeekNo]FROM Freespace;
    When I run this it's fine as below.
    Click image for larger version. 

Name:	Freespace Query.PNG 
Views:	8 
Size:	26.7 KB 
ID:	34902

    If I want to filter the 'Week-No' using the 'WHERE' clause eg
    Code:
    SELECT Freespace.[ID], Freespace.[Date], Freespace.[Aisle], Freespace.[Quantity], Freespace.[LFIE], Freespace.[LEIF], Freespace.[CountError], Freespace.[EndAccuracy], Freespace.[WeekNo]FROM Freespace
    WHERE (((Freespace.[WeekNo])=[Week-No]));
    I keep getting the following error????
    Click image for larger version. 

Name:	Freespace Query Freespace.PNG 
Views:	8 
Size:	9.0 KB 
ID:	34903

    Am i missing something??

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,550
    Use a form,
    in a textbox, txtWeekNo..

    select * from table where [weekNo]=forms!myDorm!txtWeekNo

  3. #3
    bishmedia is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    May 2018
    Posts
    44
    Really.....

    Where do i put this??
    select * from table where [weekNo]=forms!myDorm!txtWeekNo

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Build a query with query designer. The example is a dynamic parameterized query.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    bishmedia is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    May 2018
    Posts
    44
    I sussed it, the WeekNo field was setup as a 'Number', i changed it to 'ShortText' and viola : )

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

Similar Threads

  1. FieldSize Setting Error
    By batowl in forum Forms
    Replies: 9
    Last Post: 01-06-2023, 08:05 PM
  2. Replies: 18
    Last Post: 12-15-2016, 02:17 PM
  3. Replies: 3
    Last Post: 11-15-2014, 07:43 PM
  4. Setting color in SQL query
    By Giewont90 in forum Queries
    Replies: 3
    Last Post: 01-15-2012, 09:15 PM
  5. Setting a Color on a Control For Error
    By AccessLes in forum Programming
    Replies: 6
    Last Post: 06-16-2010, 12:35 PM

Tags for this Thread

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