Form_Load() textbox content behaviour

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ezechiel
    New Member
    • Jul 2009
    • 53

    Form_Load() textbox content behaviour

    Hi,

    I have the following (limited to problem):
    2 tables:
    software (sw_id (pk), sop_id(fk))
    sop(sop_id, sop_name, sop_nr)

    In the form (actually a software record):
    - a combobox
    control source: sop_id in software table
    row source: a query that populates the combobox with 0:sop_id 1:sop_name, 2:sop_nr

    - a textbox (unbound)

    Combobox_AfterU pdate:
    - insert chosen value in sop table
    - display sop_nr in textbox
    Code:
    Me.txt_workedit_sopu_nr = Me.cb_workedit_sopu.Column(2)
    This is working fine.

    If I use Form_Load() and put the code above to fill in the txtbox automatically,
    it actually works, but it takes the sop_nr of the first record in the dropdownlist..
    And not the sop_nr of the displayed one!

    I could bind the textbox and use as control source sop_id. But this displays
    the sop_id. I did this with the combobox and it works fine: it displays the name.

    Form_Open(Cance l As Integer) doesn't change a thing neither (some said to use that).

    So, how to display the sop_nr in the textbox on Form_Load?
  • ezechiel
    New Member
    • Jul 2009
    • 53

    #2
    Well, tried it again and seems it works now...
    So, following question:

    how the $#§!%¤ is it possible that things don't work, then suddenly work???
    And yes, I saved before etc..

    Comment

    • ezechiel
      New Member
      • Jul 2009
      • 53

      #3
      Moderator, please trash this topic. Thanks;

      Comment

      Working...