New with visual Basic and i have communication problem in a formular. RRS feed

  • Question

  • hi everybody,

    i am a new in VBA and i have a big problem with a created formular:Plantview.

    I have a Formular with a Combibox: Plantname  and  Listbox: TypofMachine1,

    Listbox: TypofMachine2

    I have define a query: Query1 define, which colums Plantname, Typofmachine,Blockname.

    My objective is:

    i want that if i choose a value in the Plantname in my formular Plantview and choose Block 1, that i will have in the Listbox:TypofMachine1, all the value from Query1.

    Here is my code but i have a error message: the define typ of user is not define

    I think it is not recognize the library but how can i call the library in my program. In java i know for exemple that i have to use import.


    Private Sub Block_1_Click()
    Dim qdf As ADO.Querys
    Dim sSql As String
    qdf = CurrentDb.QueryDefs("Query1")
    sSql = "SELECT qdf.Parameters(Typofmachine)"
    sSql = sSql & "WHERE (((((qdf.Parameters(Plantname))=Me.Liste9.Value) AND ((qdf.Parameters (Blockname))='Block 1'))<>False))"
    DoCmd.RunSQL sSql
    End Sub

    Kind regards,

    • Moved by Mike Feng Friday, February 22, 2013 8:51 AM
    Thursday, February 21, 2013 8:03 PM

All replies