查找具有变量名称的 recorset

Find recorset with variable name

我定义了一个全局变量:chosen_operator 然后,我需要搜索一个表单并在 [op_choice]

字段中找到包含此变量的记录集

正在尝试:

Dim rstformat As Recordset

With Forms("form_list_of_columns").rstformat  
.FindFirst CHOSEN_OPERATOR
End With

无效

我也试过

DoCmd.FindRecord CHOSEN_OPERATOR,, True,, True

总是告诉我对象未定义或...不匹配方法....

有什么想法吗?

尝试

With Forms("form_list_of_columns").Recordset  
.FindFirst "[op_choice]='" & CHOSEN_OPERATOR & "'"
End With

如果 [op_choice] 是数字,去掉单引号