Results 1 to 5 of 5

Thread: combo box

  1. #1
    Join Date
    Aug 2003
    Location
    London,UK
    Posts
    54

    Unanswered: combo box

    i have a table with propertyID and propertyName.

    i want to dynamically add the propertyName field to the combox box so a user can choose a property but also when this is selected and save button is pressed i need to use the property id and not the property name. ne help much appreciated.

  2. #2
    Join Date
    Jul 2003
    Location
    Amsterdam, Nederland
    Posts
    450

    Cool hi

    What you can do is the following

    1 Make a SQL to get your desired id



    or

    2 use the wizard when you draw a new combobox an select the id and your text field. Now when the wizard asks how the width shoud be where the id is make it as small as posible and in code get the value from the combobox with

    me.Combo1.Column(0) 'this will be the id field from the text selected in the combobox


    Good luck
    PS i woud go for option 2 (option 1 is quicker 2 make but heavyer on performance)

  3. #3
    Join Date
    Aug 2003
    Location
    London,UK
    Posts
    54

    thanks

    Thank you i have got this workinh by creating a query and using this a the source of data for the combo box.

    All i need now is some validatin that a user has choosen one of the item in the list.

    How can i check this?

    Again thnks in aadvance.

    Jas

  4. #4
    Join Date
    Jul 2003
    Location
    Amsterdam, Nederland
    Posts
    450

    Wink check the value

    you can use the following


    if me.listbox.value ="" then
    msgbox "Please choose a value " ,vbokonly+vbinformation,"PropertyName"
    me.listbox.setfocus
    exit sub
    else
    STOP'do somthing here

    endif

  5. #5
    Join Date
    Jul 2003
    Location
    Amsterdam, Nederland
    Posts
    450

    Wink euhhh it was a combobox

    but i think you get the picture, it works the same

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •