Page 4 of 4 FirstFirst 1234
Results 46 to 53 of 53
  1. #46
    dcrake's Avatar
    dcrake is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Aug 2009
    Posts
    435
    What you should be doing is this

    User selects something from combo 1

    Set the rowsource for combos 2,3 & 4 to ""
    set the rowsource for combo 2 to cascade from 1



    User selects something from combo 2

    Set the rowsource for combos 3 & 4 to ""
    set the rowsource for combo 3 to cascade from 2

    User selects something from combo 3

    Set the rowsource for combo 4 to ""
    set the rowsource for combo 4 to cascade from 3


    What you should not be doing is

    Letting a user select from a combo box unless the preceeding combo has a value in it.

    Step though each stage to validate your coding.

    David

  2. #47
    viper550 is offline Novice
    Windows XP Access 2003
    Join Date
    Nov 2009
    Posts
    28
    Ok i fixed that.Now i can choose from a combo box only if i have made a selection from the previous one.The problem is i still get the same message for the last combo box.
    =================================
    Private Sub Combo7_AfterUpdate()

    strFile = Me.Combo7.Column(3)

    End Sub
    =================================

    Run-time error '94' :

    Invalid use of Null

    Could i have made a mistake that i cannot see?I have checked and rechecked the code and it is exactly the same as the first form i had created with your help(minus the cascading combo boxes).

  3. #48
    dcrake's Avatar
    dcrake is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Aug 2009
    Posts
    435
    Ok try this

    Code:
     
    Private Sub Combo7_AfterUpdate()
    Dim x as integer
    For x = 0 to Me.Combo7.Columns.Count - 1
       debug.print Nz(me.combo7.Column(x),"Blank")
    Next
    
    strFile = Nz(Me.Combo7.Column(3),"Nothing in Column 3")
    msgbox strfile
    exit sub
     
     
    
    
    End Sub
    Wnat happens now?

    David

  4. #49
    viper550 is offline Novice
    Windows XP Access 2003
    Join Date
    Nov 2009
    Posts
    28
    I am so so stupid.I was so sure my code was correct that i checked it word by word and i found what was wrong.When i chose from the third combo box it was only loading the 3 of the 4 columns of the table.I remember fixing this but it seems i didnt save the form after that.Now it works.Thank you!!!

    Now one final problem i have to solve and im done after that.I have created a table with 5 columns (name,telephone,cellphone,fax,information).I have a form with 1 combo box and a list.How can i do it so when i select a letter from the combo box (a,b,c,d,...,z) i get the names that start with that letter in the list.What i want to do as you probably think is a phone catalogue with names.Can it be done so the names appear in alphabetic order?

  5. #50
    dcrake's Avatar
    dcrake is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Aug 2009
    Posts
    435
    Can you not use the auto complete in the combo box to fill in the rest of the name? Or do you want to use an auto find list box?

    By that I mean you have a textbox that you type into and as you type in it filters the list box with names that begin/contain the phrase you are typing in?

    David

  6. #51
    viper550 is offline Novice
    Windows XP Access 2003
    Join Date
    Nov 2009
    Posts
    28
    No i just want to select a letter from the combo box and the list to show me all the names for that letter.

  7. #52
    dcrake's Avatar
    dcrake is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Aug 2009
    Posts
    435
    Then look at the properties for the combo and it will have one that says Auto Expand set this to yes.

    David

  8. #53
    viper550 is offline Novice
    Windows XP Access 2003
    Join Date
    Nov 2009
    Posts
    28
    And how will the list be updated with only the names that start with the letter i chose from the combo box?

Page 4 of 4 FirstFirst 1234
Please reply to this thread with any new information or opinions.

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