Results 1 to 8 of 8
  1. #1
    Join Date
    Sep 2006
    Posts
    60

    Unanswered: auto-populating a lookup field

    Hi folks -

    My database entry screen has several flds that on certain conditions which I will give below must populate a lookup fld (that is, a dropdown fld with codes).

    flds involved:

    * a Bal_Due_On_Aging (just a balance fld)
    * a "Resolved" fld which = "YES" when Bal_Due fld = 0
    * a "Reason Code" fld, dropdown populated by Reason Code and description from separate lookup table.

    I want the Reason Code to auto-populate to "PD" for a record if the above conditions are met. I was able to get the Resolved and Bal_Due to work just fine. But, the Reason Code is from a table and it won't respond to if statement re the above.

    So, my question is - how to do this? Some sort of UPDATE statement? Not quite sure how to go about it, any suggestions? Thanks in advance.

    Hope I've explained it clearly enough.

    Mike

  2. #2
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    So ReasonCodeCombobox.Value="PD" doesn't work?
    Back to Access ... ADO is not the way to go for speed ...

  3. #3
    Join Date
    Sep 2006
    Posts
    60
    Nope. I tried putting in a condition from the AfterUpdates of the other flds to populate with PD IF the conditions were met. But, nada - ReasonCode fld just sits there blank. Now, I should mention that my screen now is populated by the original table rather than the query I used because the calculated flds weren't making it into the table, even if they showed up in the fld's text boxes. So, in a query, it would work fine, but I'm not basing the form on a query anymore.

  4. #4
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    How is this combobox bound? Is it bound? To what is it bound?
    Back to Access ... ADO is not the way to go for speed ...

  5. #5
    Join Date
    Sep 2006
    Posts
    60
    Let me explain: the combo is bound to a table with two flds: ReasonCode (which also sort of acts as an ID) and a description fld. The operation for entering a new code is that after entering, I have a message box pop up telling the user to double-click the fld to add a new entry. Then a small entry screen which is populated by the ReasonCode table comes up and you add a new entry. Then your entry is added and the combo is newly populated with that entry. You've seen it before in the Access templates. That's all there is to it. Trouble is, it's rowsource comes from a table rather than values. That's where the trouble lies, I think. I believe I'm going to have to somehow add the PD value to the table, or do a DLookup or something else really annoying and complicated (but, that's why we're paid the big bucks, right?).

  6. #6
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    Quote Originally Posted by mike21152
    Let me explain: the combo is bound to a table with two flds: ReasonCode (which also sort of acts as an ID) and a description fld. The operation for entering a new code is that after entering, I have a message box pop up telling the user to double-click the fld to add a new entry. Then a small entry screen which is populated by the ReasonCode table comes up and you add a new entry. Then your entry is added and the combo is newly populated with that entry. You've seen it before in the Access templates. That's all there is to it. Trouble is, it's rowsource comes from a table rather than values. That's where the trouble lies, I think. I believe I'm going to have to somehow add the PD value to the table, or do a DLookup or something else really annoying and complicated (but, that's why we're paid the big bucks, right?).
    Is it set up as a ControlSource or a RecordSource? VERY IMPORTANT ...
    Back to Access ... ADO is not the way to go for speed ...

  7. #7
    Join Date
    Sep 2006
    Posts
    60
    ControlSource is REASON_CODE. Bound to a table ReasonCodeLookup as RowSource. Has 2 flds, ReasonCode and ReasonCodeDesc.

    SELECT tbl_Reason_Code_Lookup.REASON_CODE, tbl_Reason_Code_Lookup.DESCRIPTION FROM tbl_Reason_Code_Lookup;

    You on to something, maybe?

  8. #8
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    Quote Originally Posted by mike21152
    ControlSource is REASON_CODE. Bound to a table ReasonCodeLookup as RowSource. Has 2 flds, ReasonCode and ReasonCodeDesc.

    SELECT tbl_Reason_Code_Lookup.REASON_CODE, tbl_Reason_Code_Lookup.DESCRIPTION FROM tbl_Reason_Code_Lookup;

    You on to something, maybe?
    Whoa! Is your controlsource and row source bound to the same table/query?
    Back to Access ... ADO is not the way to go for speed ...

Posting Permissions

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