Results 1 to 5 of 5
  1. #1
    5 Star Lounger
    Join Date
    Jul 2004
    Location
    Ohio
    Posts
    629
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Find Control (2k)

    I'm using the standard find control because it makes the search code simpler than i could. however, i don't want it to use the default option, which is searching from the previous control. i want it to be set on txtdrawingnumber instead of screen.previouscontrol. so i tried doing this:

    Private Sub Command73_Click()
    On Error GoTo Err_Command73_Click

    masterlist.txtdrawingnumber.SetFocus
    DoCmd.DoMenuItem acFormBar, acEditMenu, 10, , acMenuVer70

    Exit_Command73_Click:
    Exit Sub

    Err_Command73_Click:
    MsgBox Err.Description
    Resume Exit_Command73_Click

    End Sub

    but when i try this, i get the message "Object Required". is there another way of doing this?
    <img src=/w3timages/blueline.gif width=33% height=2>
    <big>John</big>

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Find Control (2k)

    What is masterlist? The name of the form? If so, replace it with Me.

  3. #3
    5 Star Lounger
    Join Date
    Jul 2004
    Location
    Ohio
    Posts
    629
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Find Control (2k)

    <img src=/S/stupidme.gif border=0 alt=stupidme width=30 height=30>

    thanks hans
    <img src=/w3timages/blueline.gif width=33% height=2>
    <big>John</big>

  4. #4
    5 Star Lounger
    Join Date
    Jul 2004
    Location
    Ohio
    Posts
    629
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Find Control (2k)

    just wondering... why doesnt specifying the form name work? is it just something w/ VBA that you have to do?
    <img src=/w3timages/blueline.gif width=33% height=2>
    <big>John</big>

  5. #5
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Find Control (2k)

    Specifying the form name is not necessary here, but in general, you would do it as follows:

    Forms!masterlist.txtdrawingnumber.SetFocus

    or

    Forms("masterlist").txtdrawingnumber.SetFocus

    The Forms collection contains all open forms.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •