具有“新记录”的自定义记录导航选项 [英] Custom record navigation with "new record" option

查看:54
本文介绍了具有“新记录”的自定义记录导航选项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个包含两个子表单的表单。主表单包含客户信息。第一个子表单包含与客户相关的所有公司信息。第二个子表单只列出公司名称,并用作第一个子表单的排序导航表单。单击导航子窗体中的记录可更改在第一个子窗体上查看的记录。作为导航子表单记录集的一部分,我有一个UNION查询来添加新记录。选项,以便我可以点击新和新。记录添加新公司。我的问题是,当我第一次创建客户记录时,我的新记录是选项没有显示。我必须关闭主表单,重新打开它,然后导航到客户的记录,然后才能获得新记录。选项可用。


我在子窗体控件级别和窗体内部尝试了导航子窗体的各种刷新/重新查询( Me.Subform.Requery 和< b> Me.Subform.Form.Requery )并没有什么区别。


有什么想法吗?

I have a form with two subforms. The main form contains customer information. The first subform contains all the company information related to the customer. The second subform just lists the company names and is used as a navigation form of sorts for the first subform. Clicking on a record in the navigation subform changes the record being viewed on the first subform. As part of the recordset of the navigation subform, I have a UNION query to add the "New Record" option so that I can just click on the "New" record to add a new company. My problem is that when I first create a customer record, my "New Record" option isn''t shown. I have to close out of the main form, reopen it and then navigate to the customer''s record before I have the "New Record" option available.

I have tried all sorts of refresh/requery of the navigation subform both at the subform control level and inside the form (Me.Subform.Requery and Me.Subform.Form.Requery) and it doesn''t make a difference.

Any ideas?

推荐答案

Seth,


如果我理解正确,当您打开此主表单时,导航子表单中会出现新客户字样。选项。但是,当您单击该选项并显示新记录时,新客户将显示新客户。选项在子表单中消失了吗?因此,您无法添加新的顺序客户?


如果您添加新客户然后选择其他客户,是否会有所不同?也就是说,一旦它消失了,它就消失了 - 直到你关闭表格并重新打开它?


你能分享你选择的代码吗?一个新客户?这可能对我们有所帮助......
Seth,

If I understand you correctly, when you open this main form, your navigation subform has the "New Customer" option. But, when you click that option, and the new record shows up, the "New Customer" option disappears in the subform? Thus, you are unable to add new sequential customers?

Does it make a difference if you add a new customer and then select a different customer? That is, once it''s gone, it''s gone--until you close the form and re-open it?

Could you share the code that fire when you select a new customer? That might help us....


这是新公司。没有出现的选项,不是新客户。客户是主要表单的一部分,相关公司是子表单的一部分。当我打开客户表单时,运行的代码会自动将其发送到新记录。我期望的是,只要我保存新客户记录,我就可以选择点击新公司。导航子窗体中的选项,以便我可以为该新客户输入公司。我可以开始输入第一个子表单(包含所有数据的子表单),但是一旦我填写了该记录,导航子表单就不会更新,所以我没有选择去新的记录进入第二家公司。我必须关闭客户主表单,然后重新打开它,导航到我刚刚输入的客户,然后我有新公司。选项。
It is the "New Company" option that doesn''t appear, not "New Customer". Customers being part of the main form and the related companies part of the subforms. When I open the customers form, the code that runs just sends it to a new record automatically. What I would expect is that as soon as I save the new customer record, I would have the option to click the "New Company" option in the navigation subform so that I can enter a company for that new customer. I can just start typing in the first subform (the one with all the data), but once I have filled in that record, the navigation subform isn''t updated, so I don''t have the option to go to a new record to enter a second company. I have to close out of the customer main form and then reopen it, navigate to the customer that I had just entered, and then I have the "New Company" option.


你提到你已经尝试了很多刷新/重新查询方法。


你在更新客户后尝试刷新cusotmer数据然后引用公司子表单?


OR ....只需单击客户子表单上的一个按钮,将您带到新公司?


我必须看到它在行动中才能真正了解正在发生的事情。但是,我认为您的底线是您希望能够在添加新客户时添加新公司,对吗?
You mention that you''ve tried many refresh/requery methods.

Have you tried, after updating the customer, refreshing the cusotmer data and then refershing the company subform?

OR.... Simply clicking a button on the customer subform that takes you to a new company?

I''d have to see it in action to really understand what is going on. But, i think your bottom line is that you want to be able to add a new company at the time of adding a new customer, correct?


这篇关于具有“新记录”的自定义记录导航选项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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