如何自动导航到下一个选项卡 [英] How do I Navigate to Next Tab Automatically

查看:89
本文介绍了如何自动导航到下一个选项卡的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




我正在尝试为大型数据库创建数据输入表单。有一个父表单,其中6个表单与一对一关系链接(由于大量字段)和几个表与一对多链接。全部都有自动更新/删除选中。日期条目表单使用选项卡控件(跨11个选项卡)和某些表的子表单。我有两个问题...


首先,**编辑表单不显示现有数据 **

其次,当使用tab键移动字段时该表,当我到达选项卡控件的末尾,而不是移动到同一记录的下一个选项卡控件时,它将移动到同一选项卡上的新记录。


我是新手,不熟悉其背后的所有代码等,所以我很感激任何建议!


谢谢

Hi,

I am trying to create a data entry form for a large database. There is a parent form with 6 forms linked with a one-to-one relationship (due to a large number of fields) and several tables linked with a one-to-many. All have auto update/delete checked. The date entry form uses tab control (across 11 tabs) and subforms for some of the tables. I have two problems...

Firstly, ** Edit Form Doesn''t Display Existing Data **

Secondly, when using the tab key to move through the fields in the table, when I get to the end of a tab control, instead of moving to the next tab control for the same record, it moves to a new record on the same tab.

I am fairly new to access and not familiar with all the code etc behind it, so I would be grateful for any advice!

Thanks

推荐答案

我建​​议你先退一步。您计划的不是通常的方法,在概念上存在很大缺陷。由于您的方法具有不寻常的性质,并且您的问题相对缺乏细节,因此很难有人以足够详细的准确度猜测您想要的内容,以便建议适当的替代方案。你描述的是子表单的正常行为。


考虑的另一种选择是带有制表符的单个表单,但在每个制表符上都有绑定字段,而不是单独的子表单。 br />

那就是说,我希望我能给出的最佳建议是重新审视整体设计,从数据结构开始(我可以想到没有一对一关系的情况)这里可能有可能,但我很少期待。


紧随其后的是用一个相当简单的结构来试验你的概念,直到你确定他们可以满足您的需求。只有这样才能在设计中构建额外的复杂功能。否则你应该明智地期待各种相关的(复杂而不是概念)问题。
I would suggest you take this a number of steps back first. What you are planning is not a usual approach and is quite flawed in concept. Due to the unusual nature of your approach, and the relative lack of detail in your question, it''s hard for someone to guess at what you want with enough detailed accuracy to allow appropriate alternatives to be suggested. What you describe is the normal behaviour of subforms.

An alternative to consider would be a single form with tabs, but having bound fields on each tab, rather than separate sub-forms.

That said, I expect the best advice I could give would be to revisit your overall design, starting with the data structure (I can think of no situation where one-to-one relationships would be desirable. There may be possibilities here, but very few I expect).

Following closely behind that would be to try out your concepts with a structure which is considerably simpler until you are sure they can handle what you need. Only then build the extra complication into your design. Otherwise you should sensibly expect all sorts of related (to the complexity rather than the concept) problems.


谢谢你的回复。我确定设计并不理想,因为我是Access的初学者!该数据库用于来自一个非常长的家庭调查的数据,主表中有大约255个字段,所以我不得不将它分成至少两个一对一的表(也许最好坚持下去) 2?)。我不知道如何解决这么多独特字段的一对一表的问题?


我有一个带有标签的表格,而且很多字段都是在选项卡上的绑定字段中。但是我无法以这种方式添加所有这些(我认为这又是因为大量的字段)。所有一对多都在子表单中。我应该说tab键问题不是子表单,而是绑定字段是每个选项卡上的最后一个字段(我很欣赏这是子表单中的正常行为)。


感谢任何建议!
Hi, thanks for your reply. I''m sure the design is not ideal as I am a beginner in Access! The database is for data from a very long household survey, and there are >255 fields in the main table so I had to split it into at least two tables with one-to-one (perhaps it would have been better to stick to 2?). I am not sure how I can get around the problem of one-to-one tables with so many unique fields?

I have a single form with tabs, and many of the fields are in bound fields on the tabs. However I could not add all of them in this way (I assume this was again becuase of the large number of fields). All the one-to-many are in subforms. I should have said that the tab key issue is not with the subforms but with the bound fields which are the last fields on each tab (I appreciate that that is the normal behaviour in subforms).

Grateful for any advice!


首先,我的原始建议仍然适用。如果您消除了这种复杂设置所涉及的许多复杂性,您仍会发现整个过程更可靠。但是,我现在就把它留给你,并考虑你面临的明显非新手问题。


我会首先考虑使用 BeforeUpdate 事件过程,用于取消任何更新的表单,但以您选择的方式触发的更新除外。这里显而易见的解决方案是提供一个命令按钮控件,用户必须单击该控件才能保存任何记录。


接下来你需要确定会发生什么,IE。通过移动选项卡上的最后一个控件来触发保存(取消)时触发哪些事件。当您可以可靠地处理这种情况时,您可以将代码放入相关事件过程中,该过程将控制权转移到下一页。


这听起来有意义吗?
First of all, my original advice still applies. You will still find the whole process more reliable if you remove many of the complexities involved with such a complicated setup. However, I''ll leave that with you for now and consider the distinctly non-newbie problem''s you''re faced with.

I would first consider using a BeforeUpdate event procedure for the form which cancels any update except those that are triggered in the way you choose. The obvious solution here would be to provide a Command Button control that the user must click on to save any record.

Next you''d need to determine what happens, IE. which events are triggered, when you trigger a save (that is cancelled) by moving past the last control on the tab. When you can reliably handle this situation you can place code in the relevent event procedure which passes control to the next page instead.

Does this sound like it makes sense?


这篇关于如何自动导航到下一个选项卡的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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