Results 1 to 5 of 5
  1. #1
    Silver Lounger
    Join Date
    Jun 2002
    Location
    Cheadle, Staffordshire
    Posts
    2,177
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Combo Empty (A2k)

    This is probably simple.

    I have 3 unbound texts which pull data from a combo:

    =cmbVehicle.Column(1)
    =cmbVehicle.Column(2)
    =cmbVehicle.Column(3)

    The combo's row source is as follows:
    SELECT tblVehicleDetails.EstimateNo, tblVehicleDetails.Supp, tblVehicleDetails.Registration, tblVehicleDetails.Manufacturer, tblVehicleDetails.Model, tblVehicleDetails.Derivitive FROM tblVehicleDetails WHERE (((tblVehicleDetails.EstimateNo)=forms!frmLabourOp erations!EstimateNo) And ((tblVehicleDetails.Supp)=forms!frmLabourOperation s!supp) And ((tblVehicleDetails.Registration) Is Not Null));

    When the form loads, the combo is blank until I select the record from it, at this point the 3 unbounds can collect there data.

    The question is, why does the combo do this and not show the record until selected.

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

    Re: Combo Empty (A2k)

    If the combo box is unbound, nothing will be selected in it unless you either set a default value in design mode, or set its value explicitly when opening the form. Do you want the first item in the combo box to be selected, or a specific item?

  3. #3
    Silver Lounger
    Join Date
    Jun 2002
    Location
    Cheadle, Staffordshire
    Posts
    2,177
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Combo Empty (A2k)

    <P ID="edit" class=small>(Edited by D Willett on 26-Jun-03 14:10. )</P>Hans
    Hopefully there should only ever be one record in the combo.
    The Vehicle which is related to [EstimateNo] & [Supp], I'll let you choose !!

    (Haven't I done this before (ItemData))
    ***************************************
    Found it
    cmbVehicle = cmVehicle.ItemData(0)
    ****************************************

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

    Re: Combo Empty (A2k)

    Glad you found it yourself. The alternative would be to set the default value of the combo box to [cmbVehicle]![ItemData](0)

    (BTW: why use a combo box if there is only one item in it? The dropdown arrow doesn't do much then. Wouldn't a list box be more appropriate?)

  5. #5
    Silver Lounger
    Join Date
    Jun 2002
    Location
    Cheadle, Staffordshire
    Posts
    2,177
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Combo Empty (A2k)

    (BTW: why use a combo box if there is only one item in it? The dropdown arrow doesn't do much then. Wouldn't a list box be more appropriate?)

    Yes it probably would, the combo sits in the footer which is hidden, so it doesn't matter if its a combo or list.
    It's just a way to pass the contents from a different table to the 3 unbounds that match the [EstimateNo] & [Supp].

    As we discussed before, DLookup's etc are slow, so this is just another way to produce the same result.
    I could have used the subform (continuous) as we did yesterday but I didn't know that when I created the combo.

    Strange but true !!



    Anyway,

Posting Permissions

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