Underlying table not updating (1 Viewer)

Peter Bellamy

Registered User.
Local time
Today, 01:03
Joined
Dec 3, 2005
Messages
295
I don't think I have ever had this before, it has me scratching my head!

I have a form which enters the data for an underlying table. Each form represents a record of the table.
There is a button on the form to print the current record by using a query.
Simple.

The problem is that the data on the form does not appear on the print unless you move to another record and then back again. So it seems the table is not getting updated as the user moves from field to field.

Should it be necessary to force an update?

Cheers
pnb
 

Lyconal

Registered User.
Local time
Yesterday, 17:03
Joined
May 18, 2009
Messages
35
Save the record before print - As the record will not exist to print until Saved.

Add the 'Save' macro before Print in the event details.
 

Peter Bellamy

Registered User.
Local time
Today, 01:03
Joined
Dec 3, 2005
Messages
295
Thanks, but.....

The form is based on a query on the table and the report is based on the same query with a filter for that record.
The query should return up to date data ???

I have not had the problem before using the same methods

pnb
 

Peter Bellamy

Registered User.
Local time
Today, 01:03
Joined
Dec 3, 2005
Messages
295
I have tried saving the form but it has made no difference
DoCmd.Save acForm, "Form Name"

???
pnb
 

namliam

The Mailman - AWF VIP
Local time
Today, 02:03
Joined
Aug 11, 2003
Messages
11,695
Need to save the record, not the form. Just create the default "save" button as available via the wizard and you should be able to find the code your looking for.
 

Peter Bellamy

Registered User.
Local time
Today, 01:03
Joined
Dec 3, 2005
Messages
295
Thanks.
That brings up an error that 'Save record is not available now'
:mad::mad:

pnb
 

Scooterbug

Registered User.
Local time
Yesterday, 20:03
Joined
Mar 27, 2009
Messages
853
Is the query that the form is based on updatable? You can test this by running the query by itself and check the navigation buttons on the bottom. If the last button is greyed out, then the query is not an updateable one.
 

Peter Bellamy

Registered User.
Local time
Today, 01:03
Joined
Dec 3, 2005
Messages
295
Yes it is updateable.
Stepping to the next record and back again enables the report to print correctly.
As I said in an earlier post the report is based on the on the same query as the form, but withe a filter to selectthe current record.

pnb
 

Peter Bellamy

Registered User.
Local time
Today, 01:03
Joined
Dec 3, 2005
Messages
295
Solved it.
Access does not like the Visula Basic window open when it does the :
RunCommand acCmdSaveRecord action.

Close that and it works as it should.
Thanks everyone !

pnb
 

Users who are viewing this thread

Top Bottom