Here my code:
The problem is Access is doing everything correctly except that when I use the access key (Alt + S) to activate the "Save Record" command button, it sends the "F2" key to the Access application and not the field that is supposed to be prepared for editing, so that a dialog box pops up asking the user what name they want to save the form to (it's a "Save Form As" dialog box).
Question: Is there a better way to set the state of a field from having its entire contents selected to having the cursor positioned at the end of the contents (it's a memo field) so the user can immediately start editing instead of having to hit "f2" themselves?
Thanks for your help.
Code:
Private Sub SaveRecord_Click()
If Me.Dirty = True Then
DoCmd.RunCommand acCmdSaveRecord
WavFileName = "c:\windows\mywav.wav"
x = sndPlaySound(WavFileName, &H0)
End If
DoCmd.GoToControl "tb_answer"
SendKeys "{f2}", True
End Sub
Question: Is there a better way to set the state of a field from having its entire contents selected to having the cursor positioned at the end of the contents (it's a memo field) so the user can immediately start editing instead of having to hit "f2" themselves?
Thanks for your help.