UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> Return To Original Record, Access 2016    
 
   
mike60smart
post Jan 14 2020, 02:11 AM
Post#1


UtterAccess VIP
Posts: 13,581
Joined: 6-June 05
From: Dunbar,Scotland


Hi Everyone

I have Form where I use a Combobox to select the record to Edit.

After Editing this record I then need to refresh the Form to update some calculations.

I have a Command button to Refresh the Form but it then takes me to the first record in the underlying Table that the Form is based on.

Does anyone know how after I Refresh the Form it stays on the record I am Editing?

Any help appreciated

--------------------
Hope this helps?

Mike

Get happiness out of your work or you may never know what happiness is.

Go to the top of the page
 
June7
post Jan 14 2020, 02:40 AM
Post#2



Posts: 1,152
Joined: 25-January 16
From: The Great Land


Review https://www.devhut.net/2012/10/19/ms-access...he-same-record/

--------------------
Attachments Manager is below the edit post window. To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
Go to the top of the page
 
Larry Larsen
post Jan 14 2020, 02:57 AM
Post#3


UA Editor + Utterly Certified
Posts: 24,410
Joined: 26-August 02
From: Melton Mowbray,Leicestershire (U.K)


Hi Mike

Not sure if this very small routine would help..
CODE
Dim CrId As Integer
CrId = Me.CurrentRecord
Me.Requery
DoCmd.GoToRecord , , acGoTo, CrId

thumbup.gif

--------------------
"Time...We have exactly the same number of hours per day that were given to Helen Keller, Pasteur, Michaelangelo, Mother Teresa, Leonardo da Vinci, Thomas Jefferson, and Albert Einstein"
H. Jackson Brown
Go to the top of the page
 
mike60smart
post Jan 14 2020, 03:25 AM
Post#4


UtterAccess VIP
Posts: 13,581
Joined: 6-June 05
From: Dunbar,Scotland


Hi Larry

Well that is very very neat.

Works a treat

Many thanks yet again
cheers.gif

--------------------
Hope this helps?

Mike

Get happiness out of your work or you may never know what happiness is.

Go to the top of the page
 
missinglinq
post Jan 14 2020, 06:00 AM
Post#5



Posts: 4,655
Joined: 11-November 02



Actually, since you say that you "need to refresh the Form to update some calculations" you could probably use Me.Recalc, instead of Me.Requery, which would avoid the problem all together.

Linq ;0)>

--------------------
BTW...The Monkey is laughing at me...not at any other poster!

The problem with making anything foolproof...is that fools are so darn ingenious!

All posts/responses based on Access 2003/2007
Go to the top of the page
 
projecttoday
post Jan 14 2020, 08:27 AM
Post#6


UtterAccess VIP
Posts: 11,438
Joined: 10-February 04
From: South Charleston, WV


I agree with missingling, why move off the record and then back again?

In addition to .Requery and .Recalc, Access offers .Refresh and .Repaint.

--------------------
Robert Crouser
Go to the top of the page
 
mike60smart
post Jan 14 2020, 12:47 PM
Post#7


UtterAccess VIP
Posts: 13,581
Joined: 6-June 05
From: Dunbar,Scotland


Hi missingling

Now that is even better.

I learn something every day

Works a treat

Many thanks
cheers.gif

--------------------
Hope this helps?

Mike

Get happiness out of your work or you may never know what happiness is.

Go to the top of the page
 
missinglinq
post Jan 14 2020, 05:41 PM
Post#8



Posts: 4,655
Joined: 11-November 02



Glad we could help!

Linq ;0)>

--------------------
BTW...The Monkey is laughing at me...not at any other poster!

The problem with making anything foolproof...is that fools are so darn ingenious!

All posts/responses based on Access 2003/2007
Go to the top of the page
 


Custom Search


RSSSearch   Top   Lo-Fi    19th January 2020 - 09:30 AM