Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

#Delete in Subforms 1

Status
Not open for further replies.

Jphillis

Technical User
Jun 27, 2001
19
0
0
GB
I have a subform that is linked to a main form in the following way:

Main form
PK quest_id - AutoNumber

Subform1
PK sheet_id - AutoNumber
FK quest_id

Subform2
PK age_id - AutoNumber
FK sheet_id
FK quest_id

I can enter information into the main form with out any problem.
After entering info into the 1st subform i try and move into the 2nd subform. Sometimes i have no problems and it functions as i expected it to. Other times when i move out of the 1st subform and into the 2nd i get #Delete in all of the fields in the 1st subform. The form freezes up and I have to close the form and reopen it. When opened again the info reappears.

Any help would be gratefully received
 
#Deleted the problem is record you view is deleted??
Am i right??
 
the record is inserted into the table but doesn't show up on the form until i close and open it again.
 
JPhillis,

Try checking the tying Link Child Fields and Link Master Fields among the forms (main, subform1, and subform2). I believe there is where the cause of the prob lies.

Now, provided you have settled the link field issues, try placing a me.requery line in the After Insert and After Update events of the main form and see what you will get. This ensures showing of updated data in the linked forms.

Hope this helps.
 
I checked the links and they were fine.
Added the Me.Requery and this seemed to work. :eek:)

A minor problem has occured as a result.

Say i was working on record 250. When i input the info now it takes it back to record 1. Is there any code that will keep it at record 250 after the requery??

Thanks for the help. It is gratefully received.
 
Pl set a BookMark variable before requery
after requerying set the bookmark again
 
I put the following code under the me.requery that makes it work

DoCmd.GoToRecord , , acLast


Thank for your help people
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top