Form Corruption

JamesJoey

Registered User.
Local time
Today, 16:50
Joined
Dec 6, 2010
Messages
642
I'm about at wits end.
My form(s) seem to become corrupted very often and I have no idea why.

I've scoured through the internet about preventing corruption and I try to adhere to this but it doesn't seem to help.
For instance, I have a split form, populated with my DVD movies, with the datasheet on the left. On the right I have 3 fields:

Title Movie Type and Movie Description. All are enabled. But, today I was unable to select the Description field. I would click in it but the cursor would not enter to field. I needed to select another field and the then I was able to select Description. I was able to select the field programmatically.

I needed to find a form from a backup and replace it.

This is just one example.

Many things occur that are very odd.

This is getting very old.
What the heck am I doing wrong?!?

Any help will be appreciated,
James
 
We actually would need more than this. Where is the cursor when the form loads? What code runs on the form, especially during while loading? Can you tab into the control when you can't click? It also wouldn't hurt to load a stripped copy of the db including that form.

It's exceedingly rare for just a form to get corrupted - usually it's either the entire database file or nothing.
 
I have several other forms that are exactly like this form except for the data.

They weren't doing it.

The cursor goes top the first field in the tab order on this and all the other forms.
 
Seriously, guy, I need more to work with than a cursory description of the effects. That's similar to asking a mechanic "my fan stopped - what's wrong with my car?".

Have you had the problem since you imported and replaced the form? When is the last time you compacted and repaired? How large is the database? Are you running any VBA code or macros when the form is opened?

Seriously, it would be a lot easier to figure out if you can post a copy of the database (cleaned) with that form and the related subforms.
 
I found something out.
It seems to have to do with the form's tab order and what fields are being shown in the datasheet side of the split form.

Currently I only have the Dvd Title being shown in the datasheet. But, the
Dvd Description was the firs one in the tab order.
I moved the Title up to the top in the tab order and it's fine. I switched it back again and the phenomena reappeared.

What this has to do with not being able to enter into the description I have no idea.

Split Forms never seem to amaze me.

I've created a db with a form and data and I'll upload it so you can see.
 
Currently the DvdSynopsis is the first field in the tab order.

Try clicking in the Synopsis field.

You need to bring the DvdTitle field to the top of the tab order
 

Attachments

The problem was that no record was selected at the start, despite your OnCurrent code (which works with a clone, not the actual recordset). Without a selected record, Access had to treat the textbox as disabled.

If you enter the following in the Load event for the form, it should fix it - at least it did in the sample database you provided:

Code:
Private Sub Form_Load()
 
    Me.Recordset.MoveFirst
 
End Sub

Mind you, since I added no error checking, if you ever open the form without data in the recordset, it's going to crash. That would have happened with your OnCurrent event anyway, though.
 
Now I need to ask:
What dies the tab order have to do with this?

Why is it when I put DvdMovieTitle the first field in the tab order, the inability to select DvdSynopsis doesn't happen??
 
Honestly, that I couldn't tell you without doing a lot more research. Might just be some sort of bug in Access, for all I know.
 
I think that part has to do with tab stop being set for the control. Nothing to load and nowhere to go.

But like you found out - setting correct tab order solves your problem.
 
Nah, not unless you're looking at a situation where there will be no records in the underlying dataset. If that's likely to happen, then you can just use something like this in the Load event instead:

Code:
If Not (Me.Recordset.EOF And Me.Recordset.BOF) Then Me.Recordset.MoveFirst

The main thing is that explicitly putting the pointer on the first record solves your problem.
 

Users who are viewing this thread

Back
Top Bottom