Form with two tab controls

RexesOperator

Registered User.
Local time
Yesterday, 19:49
Joined
Jul 15, 2006
Messages
604
I am new to Access and have not used VBA.

I have searched the forum on this, but I can't find an example of this problem.

I have a data entry form with a two-page tab control. One is for company info and the other for contact info. The recordsource is a query based on the two tables. Initially I had the page set up as a rather large form with a subform and decided to convert to the cleaner looking tab control (I used copy and paste to transfer the controls).

This form worked initially, but now I have changed some setting so that it doesn't work anymore: I can enter data properly on the first tab, but not on the second.

I have tried changing the various form properties but I must be missing something obvious. All my tab-less forms work the way I expect them to.

What I don't understand is why one tab works and not the other.
 
What did you change that broke the tabbed form?

What do you mean by not being able to enter data into second tab. That is, do you just get a blank page, or data isn't being saved, or what?

If your tabless form works even with the changes, make another form, cut and paste from tabless form into the new form with new tab control and see if it'll work.
 
I wish I knew what I had changed so I could undo it!

When I try to type in fields on the second page, the text fields behave as if they're locked. I have checked all the fields to see if they are, and they are not. Do you know why one page of the tab control will work and not the other?

I will try the cut and paste. If that doesn't work I will post a copy of the db.

I won't have time to try this until tomorrow.
 
Hmm... If you can't type in the textbox and it's not locked, then the problem would be with the query itself. How it is written may cause some fields to be locked.

Tab control does not affect how record behaves at all. In fact, tab control doesn't even change the references for the controls on the forms whereas having a subform would affect how a control is referenced.

Check your tabless form and make sure it's using the same query that you changed. If it still work with the new query, then I guess I'm stumped. :confused:
 
I have attached a stripped version of the database. Maybe someone can see where the problem is.
 

Attachments

Bad access

I have seen this before with tabbed forms. Every now and again Access loses it's mind with tabbed forms.
Solution: I created a new blank database. I exported your tables and query to this new database. I created a 2 tab form and then copied and pasted your existing fields from your "Corrupt" tabbed form into it.

Hope this helps.
 

Attachments

Dunno if this is the cause, but Allen Browne has warned about autocorrect feature. Maybe this could be why.

Here's his say.
 
Thanks for the idea about the badform file. I will look at it first thing tomorrow-I had to go to work today :(.

I have discovered (the hard way) about the autocorrect and I don't rely on it at all.
 
Sorry for the long delay. No luck using Rickster57's idea. I tried creating a new form in a new database, but the tabs don't work in the new database either. I also tried turning off the autocorrect (from reading the article it sounds like it creates more problems than it solves). I don't like the look of the linked forms (personal choice) so I will settle for using page-breaks. If I feel brave I will try the coloured tabs at fontstuff.
 
To clarify, did you export your entire database into a blank database? Simply making a new form may not always fix the corruption. It's usually good to export all objects into the blank database, and make sure you turn off the autocorrect before the export, not after.
 
No - I didn't export the whole thing. I tried with just the stripped version above. I figured if the stripped version didn't work I was back to square one anyway. I have about 50 different objects. At this point, for just one form, it is simply easier to use page-breaks. One thing I should add - I'm using Access2000 at the office (where I started the database and where the problem first appeared) , and Access2003 at home (where the problem continues). There might be a compatibility issue for some features, although, so far, I haven't found any others.
 
Well you could try and do it.

It's very painless and takes few clicks.

Create a blank database.
Turn off autocorrect.
File -> Get External Data -> Import
Navigate to your corrupted database.
Click All objects tab and select all.
?????
Profit!
 
The problem is with the underlying database and query and nothing to do with autocorrect. You are using a text field as your primary key for both tables. In your example there are some lookup tables missing which does not help.

I suggest you change your tables to have a primary key that is autonumber. In the contacts table have a foreign key that is integer and linked to the primary key of the customer table.

On the form there is no way of creating multiple contacts for a single customer. The tab for contacts needs to contain a subform that is linked to the data on the first tab page.

I regret I do not have time to do that for you at the moment but send me an IM if you need more advise.

HTH
 
I have now had a chance to make some changes to your database and the form now works. I had to create a new form so it is not too pretty at the moment but does allow you to select a customer from a combo box.
 

Attachments

I hadn't seen the select objects in the import file command! I thought I was going to have to manually copy every object. Everything now works the way I expect it to. The key well be to see if it works on the office computer as well. A million thankyous! for the info and for persisting on my problem.

To Fearnaught - the subform is linked through an invisible text field (so non-Access-users don't have to worry about it) that is auto filled from the main form ([Forms]![Form_name]![Field_name]). The lookup fields are all fixed lists so I have used value lists instead tables. I am using text fields for primary keys because I am importing data (18,000 records) from a dbaseIV table written in 1988 (not by me) that has them set up that way. I am combining two databases and two separate types of information. Text fields were the easiest way to go. Thanks for looking though.
 

Users who are viewing this thread

Back
Top Bottom