+ Reply to Thread
Results 1 to 17 of 17

Userform VBA - fetch data from table, editable, save

  1. #1
    Registered User
    Join Date
    09-11-2017
    Location
    germany
    MS-Off Ver
    2016
    Posts
    12

    Userform VBA - fetch data from table, editable, save

    Hi all,

    so I got an Userform[1] in which i want to get the values from a table[2], and if needed edit and save them.

    The first field requires a identification number to be entered. (1-1-1-0001, e.g.)
    Then on click on "Daten abrufen" the rest of the empty textfields should be filled with the data which are connected to the entered value above.

    The, in my opinion, main problem with editing the values is, the identification number is "generated" with "Raum" "Regal" "Regalsegment" (Room, Rack, Racksegment) followed by a 000X.
    The reason for this number is, to easy and accelerate the process of finding the according place to look for or put the item.

    So I would need some sort of check for "uniqueness" of the identification number, and a appropriate behavoir...

    Please Login or Register  to view this content.
    this is how the identification string is generated, if it helps in any way...


    Anyway, I managed to get a Form up and running to add all that data to a table.
    But somehow I dont find a working way to call up on them and edit them...

    Any help is much appreciated <3


    [1]: https://i.stack.imgur.com/tRCky.png
    [2]: https://i.stack.imgur.com/Xcvce.png

  2. #2
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,907

    Re: Userform VBA - fetch data from table, editable, save

    Is it possible to post an example file with your userform and some lines of data we can work with. (don't forget to desensitize data)
    Avoid using Select, Selection and Activate in your code. Use With ... End With instead.
    You can show your appreciation for those that have helped you by clicking the * at the bottom left of any of their posts.

  3. #3
    Registered User
    Join Date
    09-11-2017
    Location
    germany
    MS-Off Ver
    2016
    Posts
    12

    Re: Userform VBA - fetch data from table, editable, save

    of course,

    but please bear in mind, i am not a coder, nor i do that in any professional way. (the file might be a mess in regards of the code^^)
    It's some kind of project i want to support a local homeless shelter with...

    since I cant physically attach the file to this post,

    HTML Code: 

  4. #4
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,907

    Re: Userform VBA - fetch data from table, editable, save

    This should do it.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    09-11-2017
    Location
    germany
    MS-Off Ver
    2016
    Posts
    12

    Re: Userform VBA - fetch data from table, editable, save

    Hello Bakerman2,

    Sorry for my late response!
    Yes, in deed, you pretty much nailed it, thank you very much.
    I added some Feedback like

    Please Login or Register  to view this content.
    Since I think that might help those people who aren't that firm with computers and stuff in general.
    And yes, they still exist, these dinosaurs :D

    Is there any chance you could help me with one last thing? <3

  6. #6
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,907

    Re: Userform VBA - fetch data from table, editable, save

    If I'm able to, why not.

  7. #7
    Registered User
    Join Date
    09-11-2017
    Location
    germany
    MS-Off Ver
    2016
    Posts
    12

    Re: Userform VBA - fetch data from table, editable, save

    To be quite honest, I am totally lost with adding a search form...
    I would like to have a Userform which allows to find all entries containing "the search term(s)" and/ or the year (each entered in a separate field).
    Plus: Is it possible to enter multiple search terms? separated by commas?

    HTML Code: 
    Since I can't upload directly... :/

    Thanks in advance for your support ^-^
    -----------------------------------------------------------
    Please Login or Register  to view this content.
    This is how far I've gotten, and it kind of works.
    Now is it possible to add another textfield as an optional search condition?
    The search now is "Name only" and i would like to add the possibility to filter these by another value (Column "E")
    Last edited by sqrcbc; 09-20-2017 at 03:20 AM.

  8. #8
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,907

    Re: Userform VBA - fetch data from table, editable, save

    sqrcbc,

    Didn't forget about you but have been too busy the last few days.
    I have some ideas and will get back to you asap.

    Also can you post example file with some data in so I can test. (Testfile goes well but like to test on real data)

    Sorry.
    Last edited by bakerman2; 09-21-2017 at 12:36 AM.

  9. #9
    Registered User
    Join Date
    09-11-2017
    Location
    germany
    MS-Off Ver
    2016
    Posts
    12

    Re: Userform VBA - fetch data from table, editable, save

    I sure can upload a file, yet i cannot include proper data
    the only Thing i can include is bulk lorem ipsum stuff^^

    Will update the file in the link above, and repost it.
    in roughly 5-6 hours tho, sorry
    Last edited by sqrcbc; 10-10-2017 at 05:58 AM.

  10. #10
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,907

    Re: Userform VBA - fetch data from table, editable, save

    Open vbeditor and open searchform.
    You have the option to search for Suchbegriffe only, Jahre only or combination of both.
    Attached Files Attached Files

  11. #11
    Registered User
    Join Date
    09-11-2017
    Location
    germany
    MS-Off Ver
    2016
    Posts
    12

    Re: Userform VBA - fetch data from table, editable, save

    Here you got the latest version of my file
    with my personal progress on the searchform

    HTML Code: 

    p.s.

    could you maybe have a look at the edit form
    i somehow messed up the edit/save function...
    it doesnt really check for exisiting "combinations" (1-1-1-0001 e.g.)
    and saves it as 1-1-1-0001 even if there's already one with that "id"

    i am deeply sorry for the troubles...
    and whenever you're in berlin, i am gonna give a beer or something :D

  12. #12
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,907

    Re: Userform VBA - fetch data from table, editable, save

    This should do it.

    PS I know you Germans love beer (we Belgians too) but I'll stick to coffee if you don't mind.
    Attached Files Attached Files

  13. #13
    Registered User
    Join Date
    09-11-2017
    Location
    germany
    MS-Off Ver
    2016
    Posts
    12

    Re: Userform VBA - fetch data from table, editable, save

    Have you taken a look at the edit form? and the respective "save-function"?

    I seem to be unable to get it to work this way...

  14. #14
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,907

    Re: Userform VBA - fetch data from table, editable, save

    Works fine for me.
    If I call an existing item and change Raum, Regal und Regalsegment to an already existing item, when writing to worksheet, the last four numbers are changed to the next consecutive number.

  15. #15
    Registered User
    Join Date
    09-11-2017
    Location
    germany
    MS-Off Ver
    2016
    Posts
    12

    Re: Userform VBA - fetch data from table, editable, save

    Okay this is awkward...

    well, what if you dont Change anything at all (or just the title)?
    just call an item, and hit save, then evrything gets saved as 1-1-1-0006 e.g.

  16. #16
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,907

    Re: Userform VBA - fetch data from table, editable, save

    This should do it.
    Attached Files Attached Files

  17. #17
    Registered User
    Join Date
    09-11-2017
    Location
    germany
    MS-Off Ver
    2016
    Posts
    12

    Re: Userform VBA - fetch data from table, editable, save

    Hey Bakerman,
    at first, i am sorry for my late response, been busy with my actual job, so i couldnt quite take care of this...
    yet, once again i can just say thank you, and yet once again i would have to ask, whether there's a chance i can apply a different format to the listbox.
    I had quite some troubles with the "style" of the columns, so i made a "hard head" with an image file...

    And somehow i am totally unable to get it working with your code ^^

    Please Login or Register  to view this content.
    And i just noticed, that, if i change the data from 1-1-1-0001 to for example 2-3-1-xxxx and return to 1-1-1-xxxx, it actually takes the highest 1-1-1-xxxx value and applies +1 to it...
    same goes for the "new entry" one...
    Did i miss anything on this in general?
    Or is
    Please Login or Register  to view this content.
    simply not enough to perform a "check for the lowest possible value?

    And if you get back to me on that offered coffee, trust me, i will make sure you get the best and tallest coffee you ever had in your whole life!
    Last edited by sqrcbc; 10-23-2017 at 04:52 AM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Excel userform textBox pass SQl query and fetch data from close workbook
    By xlhelp7 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-24-2016, 03:00 AM
  2. Using userform fetch data from close workbook using SQL Query
    By xlhelp7 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-22-2016, 01:06 AM
  3. [SOLVED] Need Macro/Formula to Fetch the data from table
    By gunjan8882 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 03-16-2016, 08:12 AM
  4. Fetch Data from Access table into Excelsheet
    By aman1234 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-07-2014, 11:35 AM
  5. Replies: 3
    Last Post: 01-07-2014, 06:13 AM
  6. Populating VBA userform and Fetch previously entered data edit and make new entry
    By vijaynadiad in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 06-07-2013, 11:59 AM
  7. How to fetch the table from ASP web site and save in Excel
    By rajen87 in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 01-05-2012, 01:47 PM

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