| | |
RunTime 3075, cant see the problem? And Values are as they should be...
![]() |
•
•
Join Date: Oct 2006
Posts: 2
Reputation:
Solved Threads: 0
Hello everyone,
This is my first post on this board, I have a problem that I cant find any answers for on the web. I have a Private sub on a form, and I have sql code that draws the information that I want, but does not work when I try to set up a definition because I get the run Time error 3075. How Come? It gives me back the line of SQL code that is in the WHERE clause, [TableStudyHallHoursDetail].[Name] In (SELECT [Name] FROM [TableStudyHallHoursDetail] As Tmp GROUP BY [Name],[Date],[InTime] HAVING Count(*)>1 [Name]='" & Me!TextName & "' And [Date] ='" & Format(Me.TextDate, "\#mm\/dd\/yy\#") & "' And [InTime] ='" & Me!TextInTime & "')
Here is my code in VBA:
Once, I ran a debug.printSQL statement and it came back as
SELECT TableStudyHallHoursDetail.[Name], TableStudyHallHoursDetail.[Date], TableStudyHallHoursDetail.[InTime], TableStudyHallHoursDetail.[HourID], TableStudyHallHoursDetail.[OutTime], TableStudyHallHoursDetail.[AuditTime]FROM TableStudyHallHoursDetailWHERE (((TableStudyHallHoursDetail.Name) In (SELECT [Name] FROM [TableStudyHallHoursDetail] As Tmp GROUP BY [Name],[Date],[InTime] HAVING Count(*)>1 [Name]='Smith, Bill' And [Date] =#9/27/2006# And [InTime] =6:00:00 PM)))ORDER BY TableStudyHallHoursDetail.Name, TableStudyHallHoursDetail.Date, TableStudyHallHoursDetail.InTime;
So it seems like the information is being drawn from the table! ARRRGH
Any help would be greatly appreciated!
Thanks!
This is my first post on this board, I have a problem that I cant find any answers for on the web. I have a Private sub on a form, and I have sql code that draws the information that I want, but does not work when I try to set up a definition because I get the run Time error 3075. How Come? It gives me back the line of SQL code that is in the WHERE clause, [TableStudyHallHoursDetail].[Name] In (SELECT [Name] FROM [TableStudyHallHoursDetail] As Tmp GROUP BY [Name],[Date],[InTime] HAVING Count(*)>1 [Name]='" & Me!TextName & "' And [Date] ='" & Format(Me.TextDate, "\#mm\/dd\/yy\#") & "' And [InTime] ='" & Me!TextInTime & "')
Here is my code in VBA:
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
Private Sub TextInTime_AfterUpdate() Dim db As Database Dim rst As Recordset Dim strSQL As String Dim qdf As QueryDef Set db = CurrentDb() strSQL = "SELECT TableStudyHallHoursDetail.[Name], TableStudyHallHoursDetail.[Date], TableStudyHallHoursDetail.[InTime], TableStudyHallHoursDetail.[HourID], TableStudyHallHoursDetail.[OutTime], TableStudyHallHoursDetail.[AuditTime]" & _ "FROM [TableStudyHallHoursDetail]" & _ "WHERE [TableStudyHallHoursDetail].[Name] In (SELECT [Name] FROM [TableStudyHallHoursDetail] As Tmp GROUP BY [Name],[Date],[InTime] HAVING Count(*)>1 [Name]='" & Me!TextName & "' And [Date] ='" & Format(Me.TextDate, "\#mm\/dd\/yy\#") & "' And [InTime] ='" & Me!TextInTime & "')" & _ "ORDER BY TableStudyHallHoursDetail.Name, TableStudyHallHoursDetail.Date, TableStudyHallHoursDetail.InTime;" Set rst = db.OpenRecordset(strSQL, dbOpenSnapshot) With db Set qdf = .CreateQueryDef("tmpDuplicates", sSQL) DoCmd.OpenQuery "tmpDuplicates" .QueryDefs.Delete "tmpDuplicates" End With db.Close qdf.Close End Sub
Once, I ran a debug.printSQL statement and it came back as
SELECT TableStudyHallHoursDetail.[Name], TableStudyHallHoursDetail.[Date], TableStudyHallHoursDetail.[InTime], TableStudyHallHoursDetail.[HourID], TableStudyHallHoursDetail.[OutTime], TableStudyHallHoursDetail.[AuditTime]FROM TableStudyHallHoursDetailWHERE (((TableStudyHallHoursDetail.Name) In (SELECT [Name] FROM [TableStudyHallHoursDetail] As Tmp GROUP BY [Name],[Date],[InTime] HAVING Count(*)>1 [Name]='Smith, Bill' And [Date] =#9/27/2006# And [InTime] =6:00:00 PM)))ORDER BY TableStudyHallHoursDetail.Name, TableStudyHallHoursDetail.Date, TableStudyHallHoursDetail.InTime;
So it seems like the information is being drawn from the table! ARRRGH
Any help would be greatly appreciated!
Thanks!
Last edited by Comatose; Oct 3rd, 2006 at 5:51 pm.
![]() |
Similar Threads
- getting values from drop down menu (JSP)
- Combo box selection problem (VB.NET)
- Problem extracting values of a Dictionary (Python)
- Weird (?) problem using std::list ... (C++)
- Problem with Deviation function (Python)
- Problem in getting values of a text area by row and column wise (ASP)
- a problem wilth C program (C)
- Renaming files in C++ (C++)
Other Threads in the Visual Basic 4 / 5 / 6 Forum
- Previous Thread: Controls sintax
- Next Thread: Multiple images to a single bmp/jpg image
| Thread Tools | Search this Thread |
* 6 429 2007 access activex add age application basic beginner birth bmp calculator cd cells.find click client code college component connection connectionproblemusingvb6usingoledb copy creat ctrl+f data database datareport date delete dissertations dissertationthesis dissertationtopic edit error excel excelmacro file filename form hardware header iamthwee image inboxinvb internetfiledownload keypress label listbox listview liveperson login looping machine microsoft movingranges number objectinsert open oracle password prime program prompt range-objects readfile reading record refresh remotesqlserverdatabase report save search sendbyte sites sort sql sql2008 sqlserver subroutine tags textbox time urldownloadtofile vb vb6 vb6.0 vba visual visualbasic visualbasic6 web window windows





