且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

从未绑定到表单的表中获取数据

更新时间:2022-06-03 03:21:23


我创建了一个包含列表框的表单。列表框值来自表格。

列表框标题为XML_NODE。表单打开时,列表框显示表255.255.255.0中的值。我想将列表框中的值传递给命令按钮。命令按钮将运行将使用XML_NODE信息的批处理文件。如果操作员在表单上选择它,我可以让批处理文件接受XML_NODE值。有没有办法让列表框值传递给命令而不需要操作员选择它?


下面是我试图运行的命令
>
" c:\ List_Clients.bat" &安培;我!XML_NODE
I created a form that contains a list box. The list box value comes from a table.
The list box is Titled XML_NODE. When the form is open, the list box displays the value from the table 255.255.255.0. I want to pass the value from the list box to a command button. The command button will run a batch file that will use the XML_NODE information. I can get the batch file to accept the XML_NODE value if the operator selects it on the form. Is there a way to get the list box value to pass to the command without having the operator select it?

below is the command I am trying to run

"c:\List_Clients.bat " & Me!XML_NODE



你甚至不需要列表框,如果你甚至不希望操作员必须选择它,那你就可以通过直接从表格到您想要在On Open事件中运行的信息。

You don''t even need the listbox, if you don''t even want the operator to have to select it, then you can just pass the information directly from the table to what you want to run in the On Open event.



您甚至不需要列表框,如果您甚至不希望操作员必须选择它,那么您可以直接将信息从表格传递到您想要在On Open事件中运行的内容。
You don''t even need the listbox, if you don''t even want the operator to have to select it, then you can just pass the information directly from the table to what you want to run in the On Open event.



我假设这将在命令按钮上。我已经有一个OnClick事件将启动批处理文件。命令按钮可以有多个事件吗?我可以直接将表条目添加到OnClick事件中吗?是这样,如何添加?

I assume this would be on the command button. I already have an OnClick event that will launch the batch file. Can the command button have more than one event? Can i add the table entry directly to the OnClick event? Is so, How would it be added?


如果您不需要让操作员决定何时运行代码,那么您甚至不需要命令按钮。您可以将所有代码放在表单的On Load或On Open事件中。
If you don''t need to let the operator decide when to run the code, then you don''t even need a command button. You can just put all the code in the On Load or On Open event of the form.