Requery Subform (1 Viewer)

raphael99

Registered User.
Local time
Today, 07:39
Joined
Apr 6, 2015
Messages
126
I'm afraid... The hurry.
Db3

I digit two times entry for a patient and each time I pressed button it updates the previous entry. It does not update in real time View attachment Db3.accdb
 

jdraw

Super Moderator
Staff member
Local time
Today, 10:39
Joined
Jan 23, 2006
Messages
15,396
I'm working on a splitted database named Work. The only BE I have is Work_BE.
I include it . But I don't know if it works because the Db1 I sent it is built for the forum and it is not split.
Anyway I upload also Work_BE
View attachment 59849

I would not have spaces in field names.
I would not include total fields in tables. Calculated totals in queries when needed.

I have attached a reformatted jpg of your tables and relationships
 

Attachments

  • RelationshipsKill.jpg
    RelationshipsKill.jpg
    42.8 KB · Views: 88

Tieval

Still Clueless
Local time
Today, 15:39
Joined
Jun 26, 2015
Messages
475
The problem is very simple.

When you enter data in your form nothing happens, you press the save button and it refreshes the sub-form (without any change), then you close the form and it saves the record.

The record does not exist when you refresh the sub-form.

You need to run an update query to create the record before refreshing the form and then stop it creating another record when you close the form.
 

raphael99

Registered User.
Local time
Today, 07:39
Joined
Apr 6, 2015
Messages
126
Have set up a trick. On the mainform when clicking subform is requeryed. For the moment I can accept before engaging an update query that I should study.
But another problem has arised. If the mainform containing the subform is closed when I go to entry data from PIPForm I get error 2450 "Impossible to find form FRMMesePrecedentePIP"- how can I overcome this issue?
 

Tieval

Still Clueless
Local time
Today, 15:39
Joined
Jun 26, 2015
Messages
475
I am guessing you still have your requery in place and it cannot requery a form that is not open. The data is entered into a table so this will have no effect.
 

raphael99

Registered User.
Local time
Today, 07:39
Joined
Apr 6, 2015
Messages
126
Solved Tieval.
Simply put on mainform
Code:
Me.[FRMSottomaschera QueryPIPConcatRelatedsuMesePrecedente].Requery
on Activate e on SetFocus property.
No more error 2450, and it requery and update the form.
Thanks for your suggestion .
:eek:
 

Users who are viewing this thread

Top Bottom