+ Reply to Thread
Results 1 to 10 of 10

Editing cell value in txtbox + updating that cell value in database..going MAD!!

  1. #1
    Registered User
    Join Date
    01-17-2013
    Location
    canada
    MS-Off Ver
    Excel 2010
    Posts
    25

    Editing cell value in txtbox + updating that cell value in database..going MAD!!

    Hey,

    New to all this but here's where I'm at:

    I have a combobox which pulls up from a database a list of 100 stores. On change, (selection of store), my database info from the row corresponding to that store fills in 10+ text boxes. THE PROBLEM, I can edit a textbox value , but how do I save this one specific value in my database. How does this new cell value replace the old one. Code is as follows, I know it's dirty and the long way of doing it..but at this point, I would just like to figure out how to replace new cell value in userform into corresponding cell in database...

    Thanks for any input!!
    Matt

    Please Login or Register  to view this content.
    Cheers...

  2. #2
    Forum Contributor
    Join Date
    01-02-2007
    Location
    Australia NSW
    MS-Off Ver
    2013
    Posts
    495

    Re: Editing cell value in txtbox + updating that cell value in database..going MAD!!

    Attach to a biutton on the form after the textboxes have been updated:

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    01-17-2013
    Location
    canada
    MS-Off Ver
    Excel 2010
    Posts
    25

    Re: Editing cell value in txtbox + updating that cell value in database..going MAD!!

    Hey Corey, thanks..will try now and let you know..I add this code to the Update_Button I presume...

  4. #4
    Registered User
    Join Date
    01-17-2013
    Location
    canada
    MS-Off Ver
    Excel 2010
    Posts
    25

    Re: Editing cell value in txtbox + updating that cell value in database..going MAD!!

    Hey Corey, Thanks again....So i pasted the code in the button as shown below. Good news is im not getting any errors when the macro runs however no changes pop up anywhere in the database...any ideas as to where this info could be going, if anywhere! cheers again!

    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    01-02-2007
    Location
    Australia NSW
    MS-Off Ver
    2013
    Posts
    495

    Re: Editing cell value in txtbox + updating that cell value in database..going MAD!!

    Try placing a (') to the left of the line> On Error Resume Next
    It should highlight a line for you

  6. #6
    Forum Contributor
    Join Date
    01-02-2007
    Location
    Australia NSW
    MS-Off Ver
    2013
    Posts
    495

    Re: Editing cell value in txtbox + updating that cell value in database..going MAD!!

    Just proof read the code.

    Change the
    Please Login or Register  to view this content.
    to :
    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    01-17-2013
    Location
    canada
    MS-Off Ver
    Excel 2010
    Posts
    25

    Re: Editing cell value in txtbox + updating that cell value in database..going MAD!!

    Hey Corey,
    I've made those changes however now i'm getting a run time error of object not found in the line below:

    rngFound.Offset(, 1).Text = FrmExistingClient.txtTaxId.Text

    On the left side of equal, for rng value, i'm getting .Text="" . However on the other side for the Frm Value I'm getting the amended cell value. So it's showing up in the code, just not making it to the database...Why do you think this is, and where is this object not found error coming from as in this line seems proper to me

    Thanks ...

  8. #8
    Registered User
    Join Date
    01-17-2013
    Location
    canada
    MS-Off Ver
    Excel 2010
    Posts
    25

    Re: Editing cell value in txtbox + updating that cell value in database..going MAD!!

    **object required , and not object not found

  9. #9
    Forum Contributor
    Join Date
    01-02-2007
    Location
    Australia NSW
    MS-Off Ver
    2013
    Posts
    495

    Re: Editing cell value in txtbox + updating that cell value in database..going MAD!!

    Can you try changing all the .Text to .Value instead to see if that works.

    You need to remove the (') from in front of the On Erroe line again also.

  10. #10
    Registered User
    Join Date
    01-17-2013
    Location
    canada
    MS-Off Ver
    Excel 2010
    Posts
    25

    Re: Editing cell value in txtbox + updating that cell value in database..going MAD!!

    That was it my man!!!! Just had to change all of them and it worked like a charm! I wish I had met you 18 hours ago !! Thanks a lot buddy! Was about to start hardcoding everything otherwise!!

+ Reply to Thread

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.6.0 RC 1