auto select listbox value

  • Right what i have got is a list box that has got a total number of records in it!


    What i want to do is get a command button to be visible if the value in the list box is > 1 but i i cannot get it to select the listbox value without clicking on it!


    Saying that actually i might change it to run off the vba script instead....but if someone can give me an answer for the above it would be a great help :thanx:

  • Re: auto select listbox value


    Sounds to me that there is some confusion here.


    If your list box only has one value why are using a list box? Could you not use a text box?


    When do you want to evaluate the listbox (or text box)?


    If there is already code running that populates the list box or forces it to update then surely this code could be used to determine if the command button is visible.


    Now I am guessing.
    Do you have some form of filter on the form that updates a sub form, but you only want the command button to be visible if there are records in teh sub form? If so have a look at the Has Data property of the sub form. Then when you update your filter simply test teh hasdata property and show or hide the command button.


    HTH,


    Alan.

  • Re: auto select listbox value


    i'm running a listbox because you can run query's in this on the rowsource but either way i could not populate the text box but saying that if it was a text box it would be better
    i think im just looking in to this to far though so i have just completly blagged my self!


    cheers for the help

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!