+ Reply to Thread
Page 2 of 2 FirstFirst 12
Results 16 to 29 of 29
  1. #16
    Registered User
    Join Date
    12-28-2009
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    98

    Re: User Form Search and Update

    can someone take a second to look at the attachement and help with a solution. I am trying to get the "search" button to work.
    Attached Files Attached Files

  2. #17
    Registered User
    Join Date
    12-28-2009
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    98

    Re: User Form Search and Update

    been awhile since i had a chance to look at this post. Is there anyone who can take a few moments to help out with this issue. the attached book1 is causing me some issue as i can not seem to get the search function to work.

  3. #18
    Registered User
    Join Date
    12-28-2009
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    98

    Re: User Form Search and Update

    Can I get a forum mod to close this post as unsolved? I need help with getting a search function to work, but postulating does not get me closer to an answer or solution. There for with the lack of guidance I could use I will take my question to another forum, with higher hopes and less frustration.

  4. #19
    Forum Moderator shg's Avatar
    Join Date
    06-21-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2007
    Posts
    25,134

    Re: User Form Search and Update

    You have an unqualified range reference, which means it refers to the active sheet. So,
    Code:
    Set rSearch = Sheet3.Range("A1", Sheet3.Range("A65536").End(xlUp))
    ... or, better,
    Code:
        With Sheet3
            Set rSearch = .Range("A1", .Cells(.Rows.Count, "A").End(xlUp))
        End With
    Microsoft MVP - Excel
    Entia non sunt multiplicanda sine necessitate

  5. #20
    Forums Administrator royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    24,445

    Re: User Form Search and Update

    You left it 5 months before bumping!!!!!

    You also haven't responded to your other post,which needed the Title amending. So read the Forum Rules& follow them or don't bother posting here
    Last edited by royUK; 03-18-2010 at 03:40 AM.
    Hope that helps.

    RoyUK
    --------
    If you are pleased with a member's answer then use the Star icon to rate it, if you are pleased enough to part with cash consider a donation to Children in Need

    For Excel consulting, free examples and tutorials visit Excel Consulting-Excel VBA
    Check out the free Excel Toolbar

    New members please read & follow the Forum Rules

    Remember to mark your questions Solved and rate the answer(s)


    Code Tags: Make your code easier for us to read

  6. #21
    Registered User
    Join Date
    12-28-2009
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    98

    Re: User Form Search and Update

    Roy,

    Not sure what you mean by 5 months as I started this post roughly a month ago. And as for the other post, it is closed by Daveexcel..thanks for the suggestion though of fixing it or not posting here any more.

  7. #22
    Registered User
    Join Date
    12-28-2009
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    98

    Re: User Form Search and Update

    SHG,

    thanks that solved the issue up to that point, then it snagged a couple of lines down.

    Code:
    Private Sub cmdFind_Click()
        Dim strFind, FirstAddress As String   'what to find
        Dim rSearch As Range  'range to search
        Set rSearch = Sheet3.Range("A1", Sheet3.Range("A65536").End(xlUp))
        strFind = Me.txt1stName.Value    'what to look for
        Dim f      As Integer
        With rSearch
            Set c = .Find(strFind, LookIn:=xlValues)
            If Not c Is Nothing Then    'found it
                c.Select         '<--------- RunTime Error 1004, Select Meathod of Range class failed'
                With Me    'load entry to form
                    .txtInitial.Value = c.Offset(0, 1).Value
                    .txt2ndName.Value = c.Offset(0, 2).Value
                    .txtAddress1.Value = c.Offset(0, 3).Value
                    '.cmbAmend.Enabled = True     'allow amendment or
                    '.cmbDelete.Enabled = True    'allow record deletion
                    .cmdAdd.Enabled = False      'don't want to duplicate record
                    f = 0
                End With
                FirstAddress = c.Address
                Do
                    f = f + 1    'count number of matching records
                    Set c = .FindNext(c)
                Loop While Not c Is Nothing And c.Address <> FirstAddress
                If f > 1 Then
                    MsgBox "There are " & f & " instances of " & strFind
                    Me.Height = frmMax
                End If
            Else: MsgBox strFind & " not listed"    'search failed
            End If
        End With
    End Sub

  8. #23
    Registered User
    Join Date
    12-28-2009
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    98

    Re: User Form Search and Update

    i reconfigured some stuff in my workbook, to try to get the search function to work a little better or at all (i was hoping) but this code continues to fail me. I have seen the code work, but I have had nothing but issue after issue with it.

  9. #24
    Registered User
    Join Date
    12-28-2009
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    98

    Re: User Form Search and Update

    Need help with adding a search function to my user form.

    Attached is my workbook, current coding for the search function is not working properly. Any help is Welcome and Appreciated.
    Attached Files Attached Files

  10. #25
    Forum Moderator shg's Avatar
    Join Date
    06-21-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2007
    Posts
    25,134

    Re: User Form Search and Update

    Instead of
    Code:
    c.Select
    , which works only on the active sheet,
    Code:
    Application.GoTo c
    GoTo takes an optional argument that you should look at in Help.

    EDIT: But before you do that, put Option Explicit at the top of every module.
    Last edited by shg; 03-18-2010 at 07:43 PM.
    Microsoft MVP - Excel
    Entia non sunt multiplicanda sine necessitate

  11. #26
    Forums Administrator royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    24,445

    Re: User Form Search and Update

    Quote Originally Posted by jabryantiii View Post
    Need help with adding a search function to my user form.

    Attached is my workbook, current coding for the search function is not working properly. Any help is Welcome and Appreciated.
    You suggested that you weren't receiving the help you required,I pointed out that you didn't respond immediately. A valid point, you then gave me negative feed back for this.

    That is no way for persuading me to help, I also pointed out your lack of response to another post of yours, which actually had comments by at least two other mods.

    Please feel free to sort your own problems, I won't be helping you further & read the Forum Rules because any future infringement will result in a ban!
    Hope that helps.

    RoyUK
    --------
    If you are pleased with a member's answer then use the Star icon to rate it, if you are pleased enough to part with cash consider a donation to Children in Need

    For Excel consulting, free examples and tutorials visit Excel Consulting-Excel VBA
    Check out the free Excel Toolbar

    New members please read & follow the Forum Rules

    Remember to mark your questions Solved and rate the answer(s)


    Code Tags: Make your code easier for us to read

  12. #27
    Registered User
    Join Date
    12-28-2009
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    98

    Re: User Form Search and Update

    royUK,

    I am sorry that you feel that way. I have gone back through this thread and noticed that I have responded to every thing in a timely manner for a forum site, (within an hour or two) more over to point out again this thread was started roughly a month ago. Where you came up with 5 months is beyond me because the tag for the start of this thread is 2/17/2010.

    The reason for the negative feedback is due to the wild assumption of 5 months and using this thread to point out a mistake that I made in another thread. As well as pointing out that if I could not fix my error on that thread that I should stop posting here. As I pointed out that thread was closed and does not allow me to make any changes to it. I also emailed Daveexcel and asked him why he didn’t move it instead of closing it.

    If for some reason you feel that posturing and threatening me with being banned from this forum is warranted then please do not hesitate from fulfilling your desire. From where I sit, it seems like retaliation to a valid negative feedback.

    For the most part this forum has been a blessing for people looking to broaden their Excel and VBA knowledge but if this is the attitude and response I am not sure why anyone would come here. If I remain un-banned I will return to seek help and offer any help I can with what knowledge I have. If not I will seek help in a different venue.

  13. #28
    Registered User
    Join Date
    02-03-2012
    Location
    UK
    MS-Off Ver
    Excel 2007
    Posts
    1

    Re: User Form Search and Update

    Set rSearch = Sheets("Customer_Information").Range("i4", Range("i65536").End(xlUp))

  14. #29
    Forums Administrator royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    24,445

    Re: User Form Search and Update

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code. Posting code without them makes your code hard to read and difficult to be copied for testing. Highlight your code and click the # at the top of your post window. For more information about these and other tags, found here
    Hope that helps.

    RoyUK
    --------
    If you are pleased with a member's answer then use the Star icon to rate it, if you are pleased enough to part with cash consider a donation to Children in Need

    For Excel consulting, free examples and tutorials visit Excel Consulting-Excel VBA
    Check out the free Excel Toolbar

    New members please read & follow the Forum Rules

    Remember to mark your questions Solved and rate the answer(s)


    Code Tags: Make your code easier for us to read

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.2.0