Results 1 to 9 of 9
  1. #1
    Compufreak is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Jul 2012
    Posts
    70

    runtime errror 3075

    Hello everyone



    just a stupid error i am getting with this....

    Code:
    strSQL = strSQL & " " & "WHERE [Clusters].Cluster_Desc =" & Chr(34) & [Combo1] & Chr(34) & " and " & "WHERE Source.Day_Month_Year Between #" & DMax("Day_Month_Year", "Source") & "# AND #" & DMin("Day_Month_Year", "Source") & "#" & ";"
    can anyone tell me where i am going wrong ?

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,624
    Why the Chr(34)?

    Don't repeat the WHERE keyword.
    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.

  3. #3
    Compufreak is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Jul 2012
    Posts
    70
    hi june

    made the changes that you had told me to do.

    Code:
    strSQL = strSQL & " " & "WHERE [Clusters].Cluster_Desc =" & [Combo1] & " and " & "Source.Day_Month_Year Between #" & DMax("Day_Month_Year", "Source") & "# AND #" & DMin("Day_Month_Year", "Source") & "#" & ";"
    but i am still getting the same error . i have attached a screenshot
    Click image for larger version. 

Name:	error new.png 
Views:	6 
Size:	30.5 KB 
ID:	10728

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,624
    So Cluster_Desc is a text datatype? Need apostrophe delimiters, just as date criteria use # delimiter - numbers don't need any delimiter.

    [Clusters].Cluster_Desc = '" & [Combo1] & "' and "


    strSQL = strSQL & " WHERE [Clusters].Cluster_Desc='" & [Combo1] & "' AND Source.Day_Month_Year Between #" & DMax("Day_Month_Year", "Source") & "# AND #" & DMin("Day_Month_Year", "Source") & "#;"
    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
    Compufreak is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Jul 2012
    Posts
    70
    thanks june seems to be working

    just a tiny problem...

    im using the code below to display the dates on the report

    Code:
    
    ="Between"+Format([Forms]![ViewReportsForm]![StartDate],"\ d\ mmmm\ yyyy")+"  to  "+Format([Forms]![ViewReportsForm]![EndDate],"d\ mmmm\ yyyy")

    i made sum changes to the code and ended up with this ...
    Code:
    ="Between " & IIf(IsNull([StartDate]),DMin([Day_Month_Year),Format([Forms]![ViewReportsForm]![StartDate],"\ d\ mmmm\ yyyy")) & " to " & IIf(IsNull([EndDate]),DMax([Day_Month_Year]),Format([Forms]![ViewReportsForm]![EndDate],"\ d\ mmmm\ yyyy"))
    but it does not seem to be working

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,624
    Good you changed to & for concatenation instead of +. Although + will usually work it is also addition operator and can get unexpected results.

    The DMin and DMax functions syntax is wrong and missing the tablename.

    ="From " & IIf(IsNull([StartDate]),DMin("Day_Month_Year","Source"),Format([Forms]![ViewReportsForm]![StartDate],"\ d\ mmmm\ yyyy")) & " to " & IIf(IsNull([EndDate]),DMax("Day_Month_Year","Source"),Format([Forms]![ViewReportsForm]![EndDate],"\ d\ mmmm\ yyyy"))

    Are [StartDate] and [EndDate] fields in the report RecordSource? Why would they be null?
    ="From " & Nz([StartDate],DMin("Day_Month_Year","Source")) & " to " & Nz([EndDate],DMax("Day_Month_Year","Source"))
    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.

  7. #7
    Compufreak is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Jul 2012
    Posts
    70
    i have made just a slight change to your solution there june.

    instead of prompting to enter for a start date and end date i added the following .....


    ="From " & Nz([Forms]![ViewReportsForm]![StartDate],DMin("Day_Month_Year","Source")) & " to " & Nz([Forms]![ViewReportsForm]![EndDate],DMax("Day_Month_Year","Source"))

    thanks for all your help june , i honestly and truly appreciate it.

    just one last thing , i would like to add the following to that code just to make it display better. any idea where i can add it.
    "\ d\ mmmm\ yyyy"


  8. #8
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,624
    You want to apply that format to the date values?

    ="From " & Format(Nz([Forms]![ViewReportsForm]![StartDate],DMin("Day_Month_Year","Source")),"\ d\ mmmm\ yyyy") & " to " & Format(Nz([Forms]![ViewReportsForm]![EndDate],DMax("Day_Month_Year","Source")),"\ d\ mmmm\ yyyy")
    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.

  9. #9
    Compufreak is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Jul 2012
    Posts
    70
    thanks so much june for all your help

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

Similar Threads

  1. RunTime Error 3075 in my query
    By burrina in forum Queries
    Replies: 10
    Last Post: 01-07-2013, 08:23 PM
  2. runtime error 3075
    By Compufreak in forum Access
    Replies: 3
    Last Post: 08-14-2012, 01:40 AM
  3. RunTime error 3075
    By Compufreak in forum Access
    Replies: 3
    Last Post: 07-25-2012, 02:18 AM
  4. Runtime Error 3075 - Access 2010
    By cwturner2 in forum Programming
    Replies: 5
    Last Post: 06-29-2012, 04:03 PM
  5. Runtime 3075 error
    By whm1 in forum Programming
    Replies: 4
    Last Post: 03-24-2010, 02:50 PM

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