使用提示输入框的命令按钮打开表单以搜索记录 [英] Open a form to search for a record using a command button which prompts input box

查看:76
本文介绍了使用提示输入框的命令按钮打开表单以搜索记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在努力寻找以下的最佳方式


1.从主表单(我自己的总机)按下命令按钮打开表单

2.在表单打开之前,会出现一个输入框,询问您要查看/编辑的记录的ID号

3.表单将根据记录ID打开输入框中的值


我的主表单称为Master OFI Details我希望用户搜索的ID是OFI ID


我不确定最好的方法是通过查询,宏还是代码,但我可以'让他们中的任何一个工作!


谢谢!

I''m trying to find the best way to do the following

1. From a main form (my own switchboard) press a command button to open a form
2. Before the form opens a Input Box appears asking for the ID number of the record you want to look at / edit
3. The forms opens at the record ID based on the value in the input box

My Main form is called "Master OFI Details" and the ID I want users to seach for is "OFI ID"

I''m not sure if the best way is through a query, a macro or code but I can''t get any of them to work!

Thank you!

推荐答案

Rachelle,

我建议你避免在表格列的名称中留下空格。它为你做了额外的工作,你总是要包围对它们的引用,因为...... [OFI ID]。


在你的按钮旁边添加一个文本框并调用文本框id_txt。

在命令按钮onclick事件中试试这个:
Rachelle,
I would suggest you avoid leaving spaces in the names of your table columns. It makes extra work for you, you always have to surround references to them, as so ...[OFI ID].

Add a textbox beside your button and call the textbox id_txt.
In the command button onclick event try this:
展开 | 选择 | Wrap | 行号


感谢Jim的建议空间。不幸的是,数据库现在已经太过分了,我无法回去改变它。


我以前曾尝试过文本框方法,因为我使用该代码大量打开具有Master OFI详细信息的特定记录的相关表单,但我的方式是swtichboard。 (不是Access交换机,自己的创建)已经设置了我最终会在按钮旁边放置大量文本框,并且它不会特别方便用户使用。


理想情况下,我需要命令按钮来生成一个输入框,用户输入ID,然后将它们带到表单中的记录。在交换机上节省了很多麻烦。


Rachelle
Thanks Jim for the advise about the spaces. Unfortunatly the database is now too far gone for me to go back and change it.

I''ve previously tried the text box method as I use that code a lot to open related forms for specific records with the Master OFI details but the way my "swtichboard" (not Access switchboard, own creation) is set out I''d end up with massive amount of text boxes next to buttons and it wouldn''t be particually user friendly.

Ideally, I need the command button to generate a Input Box where the user enters the ID and then takes them to the record in the form. Saves a lot of mess on the switchboard.

Rachelle


ID代表什么?既然他们必须输入一些东西,为什么不打开表格并让他们在那里输入标识符?


Jim
What does the ID represent? Since they have to enter something why not open the form and let them enter the identifier there?

Jim


这篇关于使用提示输入框的命令按钮打开表单以搜索记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆