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
12 14042 NeoPa 32,564
Recognized Expert Moderator MVP
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.
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!
NeoPa 32,564
Recognized Expert Moderator MVP
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?
Thanks - this makes sense in theory but I have no idea how to do it... will go away and do some reading! I did have a similar but simpler database which had just one main form and several subforms, and the tab controls all worked fine. I also had a previous version of this database with one form plus subforms, which I had created in the same way but had the problem with the tab key - I have been through all the properties and built it up from scratch again but I cant figure out what's different. Thanks for your help...
In my opinion is almost impossible to have an object with more than 255 properties.
I think that this is also the reason of Access designers to limit the number of fields (at a very large range: 255).
So, every time I hear about, I suspect a (very) poor design of database.
Take a look here: http://bytes.com/topic/access/insigh...ble-structures
and see if you don't change your mind about store more than 255 fields (properties for a SINGLE object, in fact) in a single table.
sierra7 446
Recognized Expert Contributor
Rachel,
Obviously I agree that you have a highly complex situation and endorse the previous advice to simplify if possible.....
But to address the mechanics of where you are stuck, Move between Tabs, there are some variations which may seem complicated due to your complex situation. But there is logic so stay with me..
First you understand that you have Parent form. It seems that some of the fields from the Parent recordset may be grouped on individual tabs because of shortage of space.
This is the most simple case, where the next field you want to move to belongs to the same recordset i.e. not in a new sub-form. You just put some code in the Lost Focus event of the last field on your current tab to set focus to the next field you want to visit. Even if it is on a different tab-page, Access will find it and put the focus there (so long as the field is Enabled).
If you are moving from a field in the Parent recordset to a field in a Sub_Form on another tab, there are three options; - Move to the sub-form control
- Move to a control within the sub-form
- Move to the Tab Page
The first option is the simplest, just setfocus to the sub-form. The preset Tab-Order within the sub-form will then take over.
If you want to move to a specific field within the subform then you need the second line in the example below. This assumes that PhonesCustomers is a sub-form in a tab-page listing the one-to-many contacts within a customer's organisation. First set focus to the sub-form then move the focus inside it to the control you want. - Private Sub ExchangeRate_LostFocus()
-
Me!PhonesCustomers.SetFocus
-
Me!PhonesCustomers.Form!PhoneNumber.SetFocus
-
End Sub
-
The third option does much the same as the first. The tab-control has a name of its own (I have one called TabCtl72) and each tab has a Page number starting from 0 (zero). You might need to use this option in a Read-Only situation, where none of the controls in the sub-form will accept focus. - Private Sub ExchangeRate_LostFocus()
-
Me.TabCtl72.Pages(2).SetFocus
-
End Sub
-
The next problem is when you are in one sub-form and want to move the focus to another field in another sub-form. Here you have to issue three seperate commands, first to move up to the Parent form from within the first sub-form. Then to move focus to the next sub-form; and finally to a specific field. - Private Sub PhoneNumber_LostFocus()
-
Me.Parent.SetFocus
-
Me.Parent!NextSubform.SetFocus
-
Me.Parent!NextSubform.Form!NextField.SetFocus
-
End Sub
-
Note that all three commands are directed via the Parent form.
S7
Could you please try to describe what the general purpose of your application is, what it is you need to achieve with it? What kind of information are you gathering, and for what purpose.
Hi S7 !
Forget me, but I can't understand how is fired the _LostFocus event for the sub_form.
NeoPa 32,564
Recognized Expert Moderator MVP Mihail:
I can't understand how is fired the _LostFocus event for the sub_form.
That was never mentioned in S7's post. Only the last control on the form, that is within the sub-form, needs it's LostFocus event handled.
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: sophocles the wise |
last post by:
automatically post data & click buttons on sequence of web pages with
AxWebBrowser
Hi, I need to post stuff everyday to a website and am working on a VB
program to do this for me. I am a computer technician and I post an ad
on craigslist.org everyday but sometimes I don't have time to do this.
So, I accomplished so far to load the first...
|
by: Patrick Coghlan |
last post by:
I want to create about 4 forms with the same dimensions and background
colours, similar to the forms one has to traverse when installing
various software packages.
I'm using Visual Studio and C++ (changing to C# soon) and can create
separate forms, but I really just want to clone the first one, have the
user select different options on each...
|
by: husamal_ahmadi |
last post by:
Hi everyBody:
I have this question which really drive me cruzy,
By using VB.Net:
How can I let the internet explorer navigate in the same window either
by using win32 API or by using Microsoft Internet Control refreance to
my project ?
some body toled me to use ShellExcute Function in API but I tried it
|
by: zek2005 |
last post by:
Hi!!!
I've made a form with a 'select' statement through a
echo('<select name="res">');
echo('<option selected value=""> Select option</option>");');
while($row = mysql_fetch_array($resumen))
{
echo('<option value="' .$row. '">'
..strtoupper($row). '</option>');
|
by: Peter Newman |
last post by:
i have a dataset and want to step thrpugh each row each time a user clicks a
button,
| |
by: samueltilden |
last post by:
I started a new job and the version of Visual Studio 2005 that I am
now using does not have the Navigate Backward Button nor the Navigate
Forward Button in the Standard Toolbar, and they are not available
when I Add or Remove buttons from the Standard Toolbar.
(I had these two buttons in the VS 2005 of my previous job).
How can I add...
|
by: Robert Dufour |
last post by:
Vs2005, .Net 2.0, vb.Net, Winforms
I have a form with a binding source, a binding navigator, a table adapter
and a dataset (all using sql 2005 same table, to keep it simple)
When the user tries using next, previous, first or last, or closes the form
I would like to automatically detects if any changes were made and if so do
an update. If the...
|
by: Tina |
last post by:
How can I programmatically navigate a website just as a user would? click
on buttons, hyperlinks, etc. I know how to read nodes using XPath but I
don't know what classes to use to navigate.
I have to write a program to automatically read mail from an html mail
system.
Thanks,
T
|
by: esurkes |
last post by:
I have been able to create a web browser control in a form that properly opens a website based on an address from another form. Now I am trying to figure out how to set the corresponding username/password in the webpage automatically using vb. Does anyone have any idea how to do that?
Here is the script I used to open the browser:
Private...
|
by: Adam Tippelt |
last post by:
Scenario:
I've got a table for adding records, with a subtable for all data requirements related to that record.
I've built a 'view' form to navigate through the records, so that you can view the details of each. This includes a listbox to display the list of data requirements attached to each record.
I've made navigation buttons using the...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
| |
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it. ...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in...
| |
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...
| |