Results 1 to 4 of 4
  1. #1
    bishop is offline Novice
    Windows 7 Access 2007
    Join Date
    Feb 2010
    Posts
    21

    Error 3075 |1 In Query Expression '|2'

    I do not know what is causing the error

    Code:
    Private Sub cboColumnField_AfterUpdate()
    
        Dim strSQL As String
        Dim strSQLSF As String
            
        cboNumericField = Null
        
        strSQL = " SELECT DISTINCT tblDemo.Exercise FROM tblDemo "
        strSQL = strSQL & " WHERE tblDemo.Category = '" & cboRowField & "' And  "
        strSQL = strSQL & " tblDemo.SubCategory = '" & cboColumnField & "'"
        strSQL = strSQL & " ORDER BY tblDemo.Exercise;"
        
        cboNumericField.RowSource = strSQL
        
        strSQLSF = " SELECT * FROM tblDemo "
        strSQLSF = strSQLSF & " WHERE tblDemo.Category = '" & cboRowField & "' And  "
        strSQLSF = strSQLSF & " tblDemo.SubCategory = '" & cboColumnField & "'"
              
        
        Me!sfrmForm.LinkChildFields = ""
        Me!sfrmForm.LinkMasterFields = ""
         
        Me!sfrmForm.LinkChildFields = "Category;SubCategory"
        Me!sfrmForm.LinkMasterFields = "Category;SubCategory"
        Me.RecordSource = strSQLSF
        Me.Requery
    
    End Sub
    
    Private Sub cboNumericField_AfterUpdate()
    
        Dim strSQLSF As String
        
        strSQLSF = " SELECT * FROM tblDemo "
        strSQLSF = strSQLSF & " WHERE tblDemo.Category = '" & cboRowField & "' And  "
        strSQLSF = strSQLSF & " tblDemo.SubCategory = '" & cboColumnField & "' And "
        strSQLSF = strSQLSF & " tblDemo.Exercise = " & cboNumericField
        
        Me!sfrmForm.LinkChildFields = ""
        Me!sfrmForm.LinkMasterFields = ""
         
        Me!sfrmForm.LinkChildFields = "Category;SubCategory;Exercise"
        Me!sfrmForm.LinkMasterFields = "Category;SubCategory;Exercise"
        Me.RecordSource = strSQLSF
        Me.Requery
        
    End Sub
    
    Private Sub cboRowField_AfterUpdate()
    
         Dim strSQL As String
         Dim strSQLSF As String
              
         cboColumnField = Null
         cboNumericField = Null
         
         strSQL = "SELECT DISTINCT tblDemo.SubCategory FROM tblDemo "
         strSQL = strSQL & " WHERE tblDemo.Category = '" & cboRowField & "'"
         strSQL = strSQL & " ORDER BY tblDemo.SubCategory;"
         
         cboColumnField.RowSource = strSQL
                   
         strSQLSF = "SELECT * FROM tblDemo "
         strSQLSF = strSQLSF & " WHERE tblDemo.Category = '" & cboRowField & "'"
              
         Me!sfrmForm.LinkChildFields = "Category"
         Me!sfrmForm.LinkMasterFields = "Category"
         Me.RecordSource = strSQLSF
         Me.Requery
              
    End Sub
    
    Private Sub cmdShowAll_Click()
    On Error GoTo err_cmdShowAll_Click
    
         cboRowField = Null
         cboColumnField = Null
         cboNumericField = Null
         Me!sfrmForm.LinkChildFields = ""
         Me!sfrmForm.LinkMasterFields = ""
         Me.RecordSource = "tblDemo"
         Me.Requery
              
    exit_cmdShowAll_Click:
        Exit Sub
        
    err_cmdShowAll_Click:
        MsgBox Err.Description
        Resume exit_cmdShowAll_Click
        
    End Sub
    
    Private Sub Form_Open(Cancel As Integer)
    
        Dim strSQL As String
        
        strSQL = " SELECT DISTINCT tblDemo.Category FROM tblDemo ORDER BY tblDemo.Category;"
        cboRowField.RowSource = strSQL
        
    End Sub


  2. #2
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    where's the break line?

  3. #3
    bishop is offline Novice
    Windows 7 Access 2007
    Join Date
    Feb 2010
    Posts
    21
    Sorry. Here it is with break line:


    Private Sub cboColumnField_AfterUpdate()

    Dim strSQL As String
    Dim strSQLSF As String

    cboNumericField = Null

    strSQL = " SELECT DISTINCT tblDemo.Exercise FROM tblDemo "
    strSQL = strSQL & " WHERE tblDemo.Category = '" & cboRowField & "' And "
    strSQL = strSQL & " tblDemo.SubCategory = '" & cboColumnField & "'"
    strSQL = strSQL & " ORDER BY tblDemo.Exercise;"

    cboNumericField.RowSource = strSQL

    strSQLSF = " SELECT * FROM tblDemo "
    strSQLSF = strSQLSF & " WHERE tblDemo.Category = '" & cboRowField & "' And "
    strSQLSF = strSQLSF & " tblDemo.SubCategory = '" & cboColumnField & "'"


    Me!sfrmForm.LinkChildFields = ""
    Me!sfrmForm.LinkMasterFields = ""

    Me!sfrmForm.LinkChildFields = "Category;SubCategory"
    Me!sfrmForm.LinkMasterFields = "Category;SubCategory"
    Me.RecordSource = strSQLSF
    Me.Requery

    End Sub
    ----------------------------------
    Private Sub cboNumericField_AfterUpdate()

    Dim strSQLSF As String

    strSQLSF = " SELECT * FROM tblDemo "
    strSQLSF = strSQLSF & " WHERE tblDemo.Category = '" & cboRowField & "' And "
    strSQLSF = strSQLSF & " tblDemo.SubCategory = '" & cboColumnField & "' And "
    strSQLSF = strSQLSF & " tblDemo.Exercise = " & cboNumericField

    Me!sfrmForm.LinkChildFields = ""
    Me!sfrmForm.LinkMasterFields = ""

    Me!sfrmForm.LinkChildFields = "Category;SubCategory;Exercise"
    Me!sfrmForm.LinkMasterFields = "Category;SubCategory;Exercise"
    Me.RecordSource = strSQLSF
    Me.Requery

    End Sub
    ----------------------------------
    Private Sub cboRowField_AfterUpdate()

    Dim strSQL As String
    Dim strSQLSF As String

    cboColumnField = Null
    cboNumericField = Null

    strSQL = "SELECT DISTINCT tblDemo.SubCategory FROM tblDemo "
    strSQL = strSQL & " WHERE tblDemo.Category = '" & cboRowField & "'"
    strSQL = strSQL & " ORDER BY tblDemo.SubCategory;"

    cboColumnField.RowSource = strSQL

    strSQLSF = "SELECT * FROM tblDemo "
    strSQLSF = strSQLSF & " WHERE tblDemo.Category = '" & cboRowField & "'"

    Me!sfrmForm.LinkChildFields = "Category"
    Me!sfrmForm.LinkMasterFields = "Category"
    Me.RecordSource = strSQLSF
    Me.Requery

    End Sub
    ----------------------------------
    Private Sub cmdShowAll_Click()
    On Error GoTo err_cmdShowAll_Click

    cboRowField = Null
    cboColumnField = Null
    cboNumericField = Null
    Me!sfrmForm.LinkChildFields = ""
    Me!sfrmForm.LinkMasterFields = ""
    Me.RecordSource = "tblDemo"
    Me.Requery

    exit_cmdShowAll_Click:
    Exit Sub

    err_cmdShowAll_Click:
    MsgBox Err.Description
    Resume exit_cmdShowAll_Click

    End Sub
    ----------------------------------
    Private Sub Form_Open(Cancel As Integer)

    Dim strSQL As String

    strSQL = " SELECT DISTINCT tblDemo.Category FROM tblDemo ORDER BY tblDemo.Category;"
    cboRowField.RowSource = strSQL

    End Sub

  4. #4
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    NO DUDE!

    I meant....which line breaks the execution? In other words, tell me where the error occurs and I'll tell you what's wrong.

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

Similar Threads

  1. Getting Error 3075
    By boywonder in forum Programming
    Replies: 4
    Last Post: 05-23-2011, 05:06 PM
  2. Error 3075 in Append Query with link data
    By wmeparker in forum Programming
    Replies: 1
    Last Post: 05-17-2011, 10:26 AM
  3. Error 3075 when trying to preview report
    By natalie in forum Forms
    Replies: 2
    Last Post: 08-03-2010, 12:15 PM
  4. Runtime 3075 error
    By whm1 in forum Programming
    Replies: 4
    Last Post: 03-24-2010, 02:50 PM
  5. Error 3075 Missing Operator
    By KLynch0803 in forum Queries
    Replies: 5
    Last Post: 02-11-2010, 01:13 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