Sabtu, 06 Juni 2020

Re: [MSAccessProfessionals] Moving cursor to a control

The code would be something like;

Me.[name of control].SetFocus

Duane

Sent from my mobile

On Jun 6, 2020, at 12:21 PM, Russ <grizpatch@twc.com> wrote:

On my Add Record button I would like to add a line to move the cursor to the LastName Text Box.  I tried adding "DoCmd.GoToControl, LastName"  but it did not work.  What should I do to make my cursor go to the LastName Text Box?   Here is what is in the Event Procedure now:

Private Sub AddRecord_Click()
On Error GoTo Err_AddRecord_Click
 
 
    DoCmd.GoToRecord , , acNewRec
 
      
    
Exit_AddRecord_Click:
Me.List42.Requery
    Exit Sub
 
Err_AddRecord_Click:
    MsgBox Err.Description
    Resume Exit_AddRecord_Click
    
End Sub

Tidak ada komentar:

Posting Komentar