+ Reply to Thread
Results 1 to 12 of 12

Cant Modify Data with User Form - Help with code!

  1. #1
    Registered User
    Join Date
    03-30-2012
    Location
    Mexico
    MS-Off Ver
    Excel 2007
    Posts
    11

    Question Cant Modify Data with User Form - Help with code!

    Hi

    The problem is when i open the "Update Records" Form i can select the record with a list box which works OK however when i edit the records and click the button "EDIT" it does nothing!

    i've copied the code from a previous post and added some values and columns however the EDIT options is the only one not working.. IMPOTANT: i dont want to modify only the first field, i want all of them to be modify if the data is different if the same, just paste the same info.


    I'm new at this VBA stuff... your help is greatly appreciated!

    Please Login or Register  to view this content.
    ScanDB.xlsm

    THANK YOU!!!

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Cant Modify Data with User Form - Help with code!

    Hello eddyvilla,

    Bienvenido a Forum!

    The reason the UserForm would not update a record was the ComboBox loaded the records using the RowSource property. This make the ComboBox data read only. Any changes you make to the ComboBox are overridden by the RowSource range data. The code below is all the code for the UserForm "frmEditData".

    UserForm_Initialize Event Code
    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Registered User
    Join Date
    03-30-2012
    Location
    Mexico
    MS-Off Ver
    Excel 2007
    Posts
    11

    Re: Cant Modify Data with User Form - Help with code!

    HI Leith

    im getting an error "Run Time Error 1004: "Application or object defined error"

    will it be possible for you to upload a workin example?? if not please guide me in how to fix that.

    Thank you so much in advance!

  4. #4
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Cant Modify Data with User Form - Help with code!

    Hello Eddy,

    Where in the code does the error occur?

  5. #5
    Registered User
    Join Date
    03-30-2012
    Location
    Mexico
    MS-Off Ver
    Excel 2007
    Posts
    11

    Re: Cant Modify Data with User Form - Help with code!

    when i click on the button in order to show the form its when it happens, so i guess its in the Initialize Code.

  6. #6
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Cant Modify Data with User Form - Help with code!

    Hello Eddy,

    This is quite strange. When I call up your program that I saved with the changes, it gives me the same error. Earlier, it was working fine.

  7. #7
    Registered User
    Join Date
    03-30-2012
    Location
    Mexico
    MS-Off Ver
    Excel 2007
    Posts
    11

    Re: Cant Modify Data with User Form - Help with code!

    In set RNG on INITIALIZE.. the IF has 2 "II"... nevermind... no clue men!

    Thanks!
    Last edited by eddyvilla; 06-27-2012 at 06:42 PM.

  8. #8
    Registered User
    Join Date
    03-30-2012
    Location
    Mexico
    MS-Off Ver
    Excel 2007
    Posts
    11

    Re: Cant Modify Data with User Form - Help with code!

    There is something weird with the FrmEditData object name... it doesnt let me change its name!

  9. #9
    Registered User
    Join Date
    03-30-2012
    Location
    Mexico
    MS-Off Ver
    Excel 2007
    Posts
    11

    Re: Cant Modify Data with User Form - Help with code!

    Found it, for some reason its looking in the INPUT page and cant finde the object that is why in debug calls the ".show"

    Add the following in the macro calling the form.
    Please Login or Register  to view this content.
    and it should open the form.. however the combobox is adding "A2:A100" as a list.. can you modify the code to only show nonblank cells??

    THanks!!!!!!

  10. #10
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Cant Modify Data with User Form - Help with code!

    Hello Eddy,

    The code as I wrote it will find the last row with data in the column "A" starting in row 2. Are you saying if there are any blanks in that range to exclude them?

  11. #11
    Registered User
    Join Date
    03-30-2012
    Location
    Mexico
    MS-Off Ver
    Excel 2007
    Posts
    11

    Re: Cant Modify Data with User Form - Help with code!

    Never mind mate, the mistake was in my end.. now its fully functional!

    THANK YOU so MUCH!!!!!!!!!! really!

  12. #12
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Cant Modify Data with User Form - Help with code!

    Hello Eddy,

    De nada. Gusto que te puede ayudar.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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