简体   繁体   English

MS-Access组合填充

[英]Ms-access Combo Populate

For some reason my Combo box will not populate a text box field, i have done this on previous forms and even have working in different fields on this very form, but i cannot seem to get it to populate one text box. 由于某种原因,我的组合框不会填充文本框字段,我已经在以前的表单上完成过此操作,甚至在此表单上的不同字段中都进行过操作,但是我似乎无法填充一个文本框。 here is a picture to show what is happening, as well as the code. 这是一张图片,显示正在发生的事情以及代码。 in theory it should work and all the properties are set correct. 从理论上讲,它应该起作用,并且所有属性都设置正确。 This combo box is from another table though. 但是,此组合框来自另一个表。

Private Sub ProjectID_Change() 
Me.Client_Name.Value = Me.ProjectID.Column(2) 
End Sub

在此处输入图片说明

Combobox columns are numbered from (0) so you need to reference column 1 ; 组合框的列从(0)开始编号,因此您需要引用第1列;

Private Sub ProjectID_Change() 
    Me.Client_Name.Value = Me.ProjectID.Column(1) 
End Sub

And as suggested move it to the AfterUpdate event. 并按照建议将其移至AfterUpdate事件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM