VBA not working after 2000 upgrade

GRose

Registered User.
Local time
Today, 04:15
Joined
Mar 4, 2004
Messages
21
Good afternoon (well, it is here in the UK)

We have just changed from Access 97 to 2000 (only 6 years behind) and I use a database that has this piece of code running:

Private Sub DateOfAction_AfterUpdate()
DoCmd.Requery
Forms![CallLogMain]![CallLogDetails]![Child68].Requery
Forms![CallLogMain]![CallLogDetails]![Child71].Requery
Forms![CallLogMain]![CallLogDetails].SetFocus
Forms![CallLogMain]![CallLogDetails]![CallID].SetFocus
End Sub

After the record was input 2 subforms would refresh to recalculate a field storing the total time and then it would set focus to the main form to allow you move to the next record.
Now the database has changed to 2000, this no longer works which is a pain in the bum.

Any ideas why this has happened?

Regards.
 
Thank you for that link.

I have tried using the code but still can't get focus off the subform.

Any ideas.

Ta
 
GRose said:
Private Sub DateOfAction_AfterUpdate()
DoCmd.Requery
Forms![CallLogMain]![CallLogDetails]![Child68].Requery
Forms![CallLogMain]![CallLogDetails]![Child71].Requery
Forms![CallLogMain]![CallLogDetails].SetFocus
Forms![CallLogMain]![CallLogDetails]![CallID].SetFocus
End Sub

But your code is setting the focus to the main form, then back to the subform :confused:
 
Sorted it.
I opened the main form and then used the code builder to get the correct references, this is what I now use:

Requery
Forms![CallLogMain]![CallLogDetails].Form![Child68].Requery
Forms![CallLogMain]![CallLogDetails].Form![Child71].Requery
Forms![CallLogMain]![CallLogDetails].Form!Text78.SetFocus

Excuse the Text78 and Child86/71 names. Haven't had the time to change all the names to something better yet.

Still, I am happy it works now.
 

Users who are viewing this thread

Back
Top Bottom