Results 1 to 5 of 5
  1. #1
    Kevin Broecker is offline Novice
    Windows 7 64bit Access 2003
    Join Date
    Jun 2016
    Posts
    9

    Selecting Value in Combo Box Automatically

    Good morning,

    I have a combo box that has a value automatically selected based on 2 control values entered manually prior in the same form. While the result is correct when viewing the down arrow for options, it does not populate the field until I physically click on the result. I do not want my user to have to click on the result, I just want it to populate the field so I can store the answer in the table. I really don't even need the field to be visible on the form.

    Ultimately what I am trying to do is use the values of the 2 controls to provide a value in a table (Control1=tblField1 , Control2=tblField2, Value=tblField3). I am likely taking the long way around but I am not sure how to do it any other way. FYI the table is not linked to anything else because there tblField3 can have the same value for multiple combinations of tblField1 & 2. This may not be relevant but wanted to include in case it was to a response.

    As always, thank you for your time reading this post.

    Best regards,



    Kevin

  2. #2
    Micron is offline Virtually Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,818
    First, the result (sum??) of the 2 fields should not be stored in a table (save for rare exceptions). Without knowing what you're doing, I concede this could be one of them.
    Second, the behaviour you describe for the comb box is by design.
    Third, if you don't even need to see it, why make it a combo which will have no user interaction? Use a textbox and hide that.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  3. #3
    Kevin Broecker is offline Novice
    Windows 7 64bit Access 2003
    Join Date
    Jun 2016
    Posts
    9
    Micro,

    Thanks for the response.
    1. The two fields must be recorded as they are required by the government (Temperature - tblField1 and Alcohol% -tblField2) and will be used on printed documentation at the end of the process. Those two fields are used to find a volume correction factor (tblField3)which will later be used to volume correct the liquid gallons received.
    2. I can appreciate the purpose of that design
    3. I would be happy to use a txtbox but don't know how. I used the combobox because it allows me to filter the result automatically utilizing the criteria of the query in RowSource based on tblField1 and tblfield2. I am open to any other method. I just need to be able to look up the temp and alcohol combination in a table and put the correction factor in a field in another table. The lookup table looks like this:
    ID / Temp / Alc% / CorrectionFactor
    1 / 20 / 5 / 1.013

    Thanks again for your assistance.

    Kevin

  4. #4
    Micron is offline Virtually Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,818
    The textbox can lookup the value by using DLookup or a query as its record source. However, I don't know if the textbox you'd be using will be bound or not. A bound control cannot use a calculation, but there are ways around that.

    From what I've read, I'm still not able to advise if it's a good idea to store the correction factor in tblField3 as I don't fully understand what you're doing with the factor or where it comes from. It sounds like the test record should store the correction factor for historical reasons. However, I wonder about the effect should the factor change in the future due to changes in the calculation that provides it. You would have to change the stored factor (what that does to all of your test records that used it is unknown to me). It might be better to apply your calculation in the form and push the result into your test record. Again, I know nothing about how the calculation is derived and the effect any future changes might have. I guess it's enough to mention it and give you the opportunity to consider any impacts.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  5. #5
    Kevin Broecker is offline Novice
    Windows 7 64bit Access 2003
    Join Date
    Jun 2016
    Posts
    9
    Micron,

    Thanks for the additional recommendations. I believe in this case it is appropriate to store this correction factor because the number will be used to calculate a written (permanent) document that is reported to the Federal. Any update to that value would cause a discrepancy between documents if printed again. More than you likely cared to know but just so you understand a bit of the logic.

    I did not consider the DLookup / query for the textbox. I will work with that concept and see how I fair.

    Thanks again.

    Kevin

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Combo Box Not selecting value
    By data808 in forum Forms
    Replies: 3
    Last Post: 02-06-2014, 03:06 AM
  2. Selecting a field automatically selects the label
    By Access_Novice in forum Forms
    Replies: 1
    Last Post: 09-26-2013, 06:02 PM
  3. Replies: 1
    Last Post: 07-12-2012, 08:39 AM
  4. Using a combo box for selecting a form
    By tsn.s in forum Access
    Replies: 5
    Last Post: 11-01-2011, 07:29 AM
  5. Selecting Items in a combo box
    By Ferdi in forum Programming
    Replies: 6
    Last Post: 03-15-2011, 09:12 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums