• Invalid Null (Access 2000)

    Author
    Topic
    #398509

    I have tried to replace the Select Case statement enumerating the different towns,
    with the introduction of a Long Variable “town” and the following code:

    Dim town As Long
    StrAfid = ” AND ((customers.afid)” & town & “”

    My replacement is not valid since i receive the message Invaid Null.
    May i ask for help ?

    Public Function ListOfCustomers(strFormName As String)
    strBase = ” SELECT customers.Customerid, customers.CompanyName, customers.afid, tkind.kind, customers.city ” & _
    ” FROM tkind INNER JOIN customers ON tkind.kindid = customers.kindid ”
    strwhere = ” WHERE (((customers.Customerid) ” & strNotIn & “”

    Select Case Forms!USysfrmSearchCustomer![Office]
    Case 1
    StrAfid = ” AND ((customers.afid)=1))”
    Case 2
    StrAfid = ” AND ((customers.afid)=2))”
    Case 3
    StrAfid = ” AND ((customers.afid)=3))”
    Case 4
    StrAfid = ” AND ((customers.afid)=4))”
    Case 5
    StrAfid = ” AND ((customers.afid)=5))”
    Case 6
    StrAfid = ” AND ((customers.afid)=6))”
    Case 7
    StrAfid = ” AND ((customers.afid)=7))”
    Case 8
    StrAfid = ” AND ((customers.afid)=8))”
    Case 9
    StrAfid = ” AND ((customers.afid)=9))”
    Case 10
    StrAfid = ” AND ((customers.afid)=10))”
    End Select
    Forms(strFormName)!.RowSource = strBase & strwhere & StrAfid & strOrderBy
    End Function

    Viewing 1 reply thread
    Author
    Replies
    • #762485

      You don’t have an = in your expression. Also, just putting

      Dim town As Long

      doesn’t give it a value, so it will be 0. Try this instead:

      StrAfid = ” AND ((customers.afid)=” & Forms!USysfrmSearchCustomer![Office] & “))”

    • #762486

      You don’t have an = in your expression. Also, just putting

      Dim town As Long

      doesn’t give it a value, so it will be 0. Try this instead:

      StrAfid = ” AND ((customers.afid)=” & Forms!USysfrmSearchCustomer![Office] & “))”

    Viewing 1 reply thread
    Reply To: Reply #762485 in Invalid Null (Access 2000)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information:




    Cancel