×

Loading...

Topic

This topic has been archived. It cannot be replied.
  • 工作学习 / IT技术讨论 / 请教Access : 各位高手,请教一个关于COMBO BOX 的问题。
    COMBO BOX只能看见一个FIELD,但一个FIELD并不能IDENTIFY一个RECORD,例如IDENTIFY一个顾客,可以用CUST_id 来IDNETIFY 一个顾客,但对于用户来说,用名字更容易查找,但有可能同名同姓。我的解决办法是用ID查找,一选完ID后,在另一TEXT BOX 里,顾客的名字自动出现。注: 顾客的ID,名字已在CUSTOMER TABLE 里,ID,NAME 在同一RECORD里。

    我的问题是,在ACCESS,如何写 CODE 来实现选完ID后,另一TEXT BOX,顾客名字自动出现。

    万分感激热心帮助。
    • afterupdate
      (1) write code for combo box 'afterupdate' event
      (2) or you may like to leave the extra textbox, you can make the cbobox
      display the name, while bind to a unique ID.
      • Hi, Mc, Thank you very much. But still there is problem.
        I try method 2. I bind it to ID, the column count is 3. I want it display name, so I set Bound Column to 3, but it still show ID. I tried serveral time to change Bound Column to 1 or 2 or 3, it sometimes display name, but when I enter new record, It returns to show ID even the previous record display name. Please help!!
        • notinthelist
          when bind to ID, while display the name, and you also want to allow
          user to input new record, you need to code for the 'notinthelist' event.
          in the event code, insert a new record into table, and then do the 'requery' to update the combo list.