Trouble adding records

D

Dave P.

When I add a record using a form the details all go in fine and they all
appear in the data table from which the form is designed. However, when I go
back to the form the new records are not to be found.

Reports do not include the new data eitherif they are entered using the form
but they are there if I enter the data using the table. Any help would be
grateful.

Thanks
 
K

Klatuu

Is it possible the form is in Data Entry mode? A Data Entry form will not
show existing records. It is designed for the purpose of entering new
records only.

As to the report, it depends on when the report is run. If you run the
report while your form is still open, it will not include the records added
during the current session of the form. That is because they have been added
to the form's recordset, but not updated to the table until you either close
the form or requery it. To get the records included before you run the
report from this form, try
Me.Requery just before you open the report.
 
D

Dave P.

The data base is a list of pupils that I teach and their contact detasils.
They are all in a table called 'Pupil Table'. The form uses all the fields to
enter the info in a more user friendly manner. There were 119 records which
were entered with no problems at all.

All the info I now add using the form is added to the table but when I
return to the form the new info has disappeared. I can see all 119 records
previously entered.

No matter when I run the report, only the old info is included.

I'm sure a recent system restore has caused the problem but I don't know how
to repair the database.
 
K

Klatuu

It sounds like you may have some database corruption going on.
Start by making a backup of your mdb.
Do a Decompile. (See info here -
http://www.granite.ab.ca/access/decompile.htm)
Recompile you mdb.

If that does not resolve it, then you may need to recreate it. The process
is:
As always, do a backup of the mdb.

For each form and report that has code:
Open the form/report module:
Copy the entire content of the module and paste it into a text editor
(notepad)
Set the form/report Has Module property to No.
Create a new mdb.
Copy all your objects from the original mdb.
Open each form/report.
Set the Has Module property back to Yes.
Open the code module.
Paste the code for the object into the module.
Compile the mdb.
Pray.
 
D

Dave P.

I'm sure this process would work but I decided on another strategy. I started
a new database and imported all the tables, forms and reports one at a time.
I kept the problem form till last.

There seems to have been a break in the link between the form I used for
entering the data and the rest of the database because everything else worked.

Anyway, I now have a working database (I created another data entry form!).

Many thanks for your help.
 
Top