Results 1 to 6 of 6
  1. #1
    2 Star Lounger
    Join Date
    Jan 2002
    Location
    Delta, Br. Columbia
    Posts
    116
    Thanks
    1
    Thanked 0 Times in 0 Posts
    I'm sure there is probably an easy way to do this but...

    The database deals with cabinet manufacturing quotations for rooms in a house. When the user selects a room I set up default values for a number of combo boxes. That appears to work fine in that the correct data for the item is displayed and saved. However the additional data selected in the sql of the combo box, when these combo boxes are actually used, does not appear to load when using the default value. This data, using the .column property, is used to calculate pricing etc. I could write code to get at the remaining data but I was wondering if there is an easier method or if I am not loading the defaults correctly?

    Code used to set initial values:

    Me.Drawer_Slide_ID = 2

  2. #2
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,624
    Thanks
    3
    Thanked 60 Times in 60 Posts
    Have you tried doing a Refresh or a Requery on the combo box. I think it may require that to load the combo box initially - but I haven't tested it.
    Wendell

  3. #3
    2 Star Lounger
    Join Date
    Jan 2002
    Location
    Delta, Br. Columbia
    Posts
    116
    Thanks
    1
    Thanked 0 Times in 0 Posts
    The combo box is correctly loaded at the start, however I tried a requery and it did not solve the problem. I also tried refreshing the screen and alos no louck.

    I suspect I was not very clear in my initial post:

    The query behind the combo box selects the Drawer_Slide_ID, Drawer_Slide_Description. Drawer_Slide_Price. The column widths are 0,2,0

    Drawer_Slide_ID.column(2) is subsequently used to adjust the pricing of the cabinet.

    If you select a Drawer_Slide_ID using the combo box, column(2) is correctly stored in the appropriate field.

    What we want to do is pre-initialize Drawer_Slide_ID to the value 2 and then have the other columns be available. When I do that the correct description is displayed but zero is displayed for the Price.

    Hopefully this is clearer

  4. #4
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,624
    Thanks
    3
    Thanked 60 Times in 60 Posts
    What happens if you set the default value instead of setting the current value? I am under the impression that the combo box doesn't actually populate the row source until it receives focus for the first time. Is your combo box row source pointing to a table, or is it values set in the properties?
    Wendell

  5. #5
    Gold Lounger
    Join Date
    Jun 2001
    Location
    Crystal Beach, FL, Florida, USA
    Posts
    3,436
    Thanks
    1
    Thanked 34 Times in 34 Posts
    Quote Originally Posted by Peter_Thesiger View Post
    The combo box is correctly loaded at the start, however I tried a requery and it did not solve the problem. I also tried refreshing the screen and alos no louck.

    I suspect I was not very clear in my initial post:

    The query behind the combo box selects the Drawer_Slide_ID, Drawer_Slide_Description. Drawer_Slide_Price. The column widths are 0,2,0

    Drawer_Slide_ID.column(2) is subsequently used to adjust the pricing of the cabinet.

    If you select a Drawer_Slide_ID using the combo box, column(2) is correctly stored in the appropriate field.

    What we want to do is pre-initialize Drawer_Slide_ID to the value 2 and then have the other columns be available. When I do that the correct description is displayed but zero is displayed for the Price.

    Hopefully this is clearer
    I have to believe that when you say "Drawer_Slide_ID.column(2) is subsequently used to adjust the pricing of the cabinet", you are running some code (perhaps in the combo box's AfterUpdate event). You need to get this code to run when you "pre-initialize".
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

  6. #6
    2 Star Lounger
    Join Date
    Jan 2002
    Location
    Delta, Br. Columbia
    Posts
    116
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Many thanks for the replies. Yes of course the code to set up the fields has to be run before the values change and that is what I forgot - me brain was in sleep mode

Posting Permissions

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