您没有运行查询。如果您希望数据填写到字段中,您应该将表单的记录源设置为 sql。
Me.RecordSource = "SELECT Description_Of_Problem, Other, Etc FROM Work_Orders"
上述方法仅在您将控件绑定到字段时才有效,但这是填充大量控件的最简单方法。
最好的开始方式是使用表单向导基于 Work_Orders 创建一个表单。然后,您可以通过创建一个组合框来选择表单上的记录,从而完全避免任何编码。然后,用户可以选择一张票并跳转到该记录。也有一个向导。
Dim rs As DAO.Recordset
ticNum = Me.Work_Order_List.Value
strSQL = "SELECT Description_Of_Problem FROM Work_Orders WHERE Ticket_Number =" _
& ticNum
Debug.Print strSQL
Set rs = CurrentDB.OpenRecordset strSQL
Me.Notes = rs!Description_Of_Problem
绑定表单
基于表或查询启动表单向导

按照步骤完成设计视图中的表单

有许多方法可以浏览记录,您似乎喜欢列表框。添加一个列表框,确保选择了该向导。

选择在当前表单上查找记录

并选择要出现在列表框中的项目

选择一个项目以在表单上找到它。

This is what makes it a bound form, the record source, which can be a table name, a query name or an SQL statement. Note that the control to be filled in automatically are bound to field names, but the listbox to find records is marked 'unbound'.
