help with runtime error

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rnero
    New Member
    • Sep 2007
    • 2

    #1

    help with runtime error

    I keep getitng this 2001 - You canceled the previous operation.
    Some one please help me.
    Here is the code.

    Option Compare Database
    Option Explicit

    Private Sub cboColumnField_ AfterUpdate()

    Dim strSQL As String
    Dim strSQLSF As String

    cboNumericField = Null

    strSQL = " SELECT DISTINCT tblDemo.Numeric Field FROM tblDemo "
    strSQL = strSQL & " WHERE tblDemo.RowFiel d = '" & cboRowField & "' And "
    strSQL = strSQL & " tblDemo.ColumnF ield = '" & cboColumnField & "'"
    strSQL = strSQL & " ORDER BY tblDemo.Numeric Field;"

    cboNumericField .RowSource = strSQL

    strSQLSF = " SELECT * FROM tblDemo "
    strSQLSF = strSQLSF & " WHERE tblDemo.RowFiel d = '" & cboRowField & "' And "
    strSQLSF = strSQLSF & " tblDemo.ColumnF ield = '" & cboColumnField & "'"


    Me!sfrmForm.Lin kChildFields = ""
    Me!sfrmForm.Lin kMasterFields = ""

    Me!sfrmForm.Lin kChildFields = "RowField;Colum nField"
    Me!sfrmForm.Lin kMasterFields = "RowField;Colum nField"
    Me.RecordSource = strSQLSF
    Me.Requery

    End Sub

    Private Sub cboNumericField _AfterUpdate()

    Dim strSQLSF As String

    strSQLSF = " SELECT * FROM tblDemo "
    strSQLSF = strSQLSF & " WHERE tblDemo.RowFiel d = '" & cboRowField & "' And "
    strSQLSF = strSQLSF & " tblDemo.ColumnF ield = '" & cboColumnField & "' And "
    strSQLSF = strSQLSF & " tblDemo.Numeric Field = " & cboNumericField

    Me!sfrmForm.Lin kChildFields = ""
    Me!sfrmForm.Lin kMasterFields = ""

    Me!sfrmForm.Lin kChildFields = "RowField;Colum nField;NumericF ield"
    Me!sfrmForm.Lin kMasterFields = "RowField;Colum nField;NumericF ield"
    Me.RecordSource = strSQLSF
    Me.Requery

    End Sub

    Private Sub cboRowField_Aft erUpdate()

    Dim strSQL As String
    Dim strSQLSF As String

    cboColumnField = Null
    cboNumericField = Null

    strSQL = "SELECT DISTINCT tblDemo.ColumnF ield FROM tblDemo "
    strSQL = strSQL & " WHERE tblDemo.RowFiel d = '" & cboRowField & "'"
    strSQL = strSQL & " ORDER BY tblDemo.ColumnF ield;"

    cboColumnField. RowSource = strSQL

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

    Me!sfrmForm.Lin kChildFields = "RowField"
    Me!sfrmForm.Lin kMasterFields = "RowField"
    Me.RecordSource = strSQLSF
    Me.Requery

    End Sub

    Private Sub cmdShowAll_Clic k()
    On Error GoTo err_cmdShowAll_ Click

    cboRowField = Null
    cboColumnField = Null
    cboNumericField = Null
    Me!sfrmForm.Lin kChildFields = ""
    Me!sfrmForm.Lin kMasterFields = ""
    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(Cance l As Integer)

    Dim strSQL As String

    strSQL = " SELECT DISTINCT tblDemo.RowFiel d FROM tblDemo ORDER BY tblDemo.RowFiel d;"
    cboRowField.Row Source = strSQL

    End Sub
Working...