我正在处理表单并为数据输入和搜索(数据提取)制作了一个表单,但问题是我在某些文本框上使用了 Dlookup 公式以便于数据输入但是当我尝试搜索访问时没有显示数据文本框并显示该对象是只读的错误。如何获取文本框显示数据以及 Dlookup 公式?请帮忙。多谢
问问题
2034 次
1 回答
0
You can set the textbox value by code instead of putting the DLookup
into the data source of the textbox.
Putting it into the data source means that you can't edit the textbox at runtime, as you experienced.
But you can set the value once in the Form_Open
event, for example:
Private Sub Form_Open(Cancel As Integer)
Me.TheTextBox = DLookup(...)
End Sub
This will cause the textbox to be filled automatically when the form opens, but the textbox is editable and you can overwrite the value.
于 2013-04-15T05:20:08.107 回答