Results 1 to 5 of 5

Thread: compo box (2k)

  1. #1
    2 Star Lounger
    Join Date
    Nov 2002
    Posts
    160
    Thanks
    0
    Thanked 0 Times in 0 Posts

    compo box (2k)

    i hvae a tabl called tbl names contain 2 feald ( id and name )
    like
    id name
    10 - ashraf
    20-mohamed
    another forme called data there are a compobox calld named deponds on the names from tbl nams . i want to make name ashraf is a default in the name feald in data form .

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: compo box (2k)

    I assume that your combo box has:
    Row Source Type: Table/Query
    Row Source: the names table
    Bound Column: 1
    Column Count: 2
    Column Widths: 0";1" (or something similar with the first column width = 0)

    Although this combo box displays the name, it stores the corresponding ID. If you want to set a default value, you must supply the corresponding ID. So to set Ashraf as default, enter 10 (Ashraf's ID) in the Default Value property of the combo box.

  3. #3
    2 Star Lounger
    Join Date
    Nov 2002
    Posts
    160
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: compo box (2k)

    yes . that is right , but if i want to change the default to other name i should to goto disign view to modifi it . i want to but the names in a form and the 1st name ( ashraf) is a default if i change ashraf's name any time to mohamed , Mohamed is a default name .

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: compo box (2k)

    Why didn't you ask that the first time? Set the Default Value property of your combo box to

    =[Named].[ItemData](0)

    where Named is the name of your combo box. The ItemData(0) refers to the first item in the list (counting starts at 0).

  5. #5
    2 Star Lounger
    Join Date
    Nov 2002
    Posts
    160
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: compo box (2k)

    it's ok now . sorry dear 4 my bad explan .
    Ashraf

Posting Permissions

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