OnNextRecord

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • JLM

    OnNextRecord

    Ok. Now I have a form where the user enters data. After clicking the "Add
    Another Record" button, I want a specific field to have focus. I can't seem
    to find the way to do this. What am I missing?

    Thanks in advance.
    jeff


  • PC Datasheet

    #2
    Re: OnNextRecord

    Enter this after the last line in the code for your button:
    Me!NameOfSpecif icField.SetFocu s


    --
    PC Datasheet
    Your Resource For Help With Access, Excel And Word Applications
    resource@pcdata sheet.com



    "JLM" <jeff.morrell@c olostate.edu> wrote in message
    news:40296239@n ews.ColoState.E DU...[color=blue]
    > Ok. Now I have a form where the user enters data. After clicking the "Add
    > Another Record" button, I want a specific field to have focus. I can't seem
    > to find the way to do this. What am I missing?
    >
    > Thanks in advance.
    > jeff
    >
    >[/color]


    Comment

    • Pieter Linden

      #3
      Re: OnNextRecord

      "JLM" <jeff.morrell@c olostate.edu> wrote in message news:<40296239@ news.ColoState. EDU>...[color=blue]
      > Ok. Now I have a form where the user enters data. After clicking the "Add
      > Another Record" button, I want a specific field to have focus. I can't seem
      > to find the way to do this. What am I missing?
      >
      > Thanks in advance.
      > jeff[/color]

      try something like this...
      Option Compare Database

      Private Sub Command4_Click( )
      On Error GoTo Err_Command4_Cl ick


      DoCmd.GoToRecor d , , acNewRec
      Me.Controls("My TextField").Set Focus '<---add this line. Substitute
      the name of your field

      Exit_Command4_C lick:
      Exit Sub

      Err_Command4_Cl ick:
      MsgBox Err.Description
      Resume Exit_Command4_C lick

      End Sub

      Comment

      • Trevor Best

        #4
        Re: OnNextRecord

        On Tue, 10 Feb 2004 15:59:05 -0700 in comp.databases. ms-access, "JLM"
        <jeff.morrell@c olostate.edu> wrote:
        [color=blue]
        >Ok. Now I have a form where the user enters data. After clicking the "Add
        >Another Record" button, I want a specific field to have focus. I can't seem
        >to find the way to do this. What am I missing?
        >
        >Thanks in advance.
        >jeff
        >[/color]
        Sub Form_Current()
        If Me.NewRecord then
        somecontrol.set focus
        end if
        End Sub
        --
        A)bort, R)etry, I)nfluence with large hammer.

        Comment

        • JLM

          #5
          Re: OnNextRecord

          Perfect. This is Exactly what I was after.

          Thank you.
          JLM


          "PC Datasheet" <spam@nospam.sp am> wrote in message
          news:joeWb.1998 9$jH6.14999@new sread1.news.atl .earthlink.net. ..[color=blue]
          > Enter this after the last line in the code for your button:
          > Me!NameOfSpecif icField.SetFocu s
          >
          >
          > --
          > PC Datasheet
          > Your Resource For Help With Access, Excel And Word Applications
          > resource@pcdata sheet.com
          > www.pcdatasheet.com
          >
          >
          > "JLM" <jeff.morrell@c olostate.edu> wrote in message
          > news:40296239@n ews.ColoState.E DU...[color=green]
          > > Ok. Now I have a form where the user enters data. After clicking the[/color][/color]
          "Add[color=blue][color=green]
          > > Another Record" button, I want a specific field to have focus. I can't[/color][/color]
          seem[color=blue][color=green]
          > > to find the way to do this. What am I missing?
          > >
          > > Thanks in advance.
          > > jeff
          > >
          > >[/color]
          >
          >[/color]


          Comment

          Working...