0

最新更新(周一晚上)

首先,我成功显示并从我的 city_table 中选择,在表单上填充 city_no

然后,我尝试使用该值在同一表单上提取/使用 city_nm 和 state_nm。

我将此编码为 city_no 的(修改后的)更新后代码。

Private Sub city_no_AfterUpdate()  
Dim got_city_nm, got_state_nm  
got_city_nm = DLookup("[city_nm]", "city_table", "[city_no]" = "city_no")  
got_city_nm = DLookup("city_nm", "city_table", "city_no='" & Me.city_no & "'")  
city_nm = got_city_nm  
got_state_nm = DLookup("[state_nm]", "city_table", "[city_no]" = "city_no")  
got_state_nm = DLookup("state_nm", "city_table", "city_no='" & Me.city_no & "'")  
state_nm = got_state_nm  
seat_no = "XXX"  
End Sub  

仍然没有任何反应,包括最后一条语句(将“XXX”分配给 seat_no)

所以我将其简化为自己尝试:

Private Sub city_no_AfterUpdate()  
seat_no = "XXX"  
End Sub  

依然没有。我显然错过了一些简单而琐碎的事情。

4

1 回答 1

0

RecordSourceCity Name 文本框的属性设置为:

=DLookup("[city_nm]", "city_table", "[city_no]" = "city_no").

然后将RecordSourceState Name 文本框的属性设置为:

=DLookup("[state_nm]", "city_table", "[city_no]" = "city_no")

于 2013-07-08T07:44:59.683 回答