+ Reply to Thread
Results 1 to 21 of 21

data management system using userform

  1. #1
    Forum Contributor
    Join Date
    05-06-2009
    Location
    Singapore
    MS-Off Ver
    Excel 2003
    Posts
    361

    data management system using userform

    Hi, Im trying to make a data management system based in excel, and i have alot of questions that needs help with. Previously, i tried making individual example workbooks and posting a new thread for every question that i have. In the end, because every answer is tailored to each specific question, i had a hard time trying to combine them together in the actual workbook. So now im posting the workbook that im working on so that anyone who wants to help has a clear picture of where im going.

    Maybe i will start by asking this question:
    in the userform under "Sample manager" tab, combobox7 takes data from sheet "Case Log" column A. What i hope to achieve in combobox8 is that it populates only with values that contain 2 hyphens. For example, user selects DVI-00001 in combobox7, combobox8 should only show DVI-00001-001 and DVI-00001-002 instead of including DVI-00001-001-1 and DVI-00001-001-2.

    Attached workbook for reference (file is over 2MB so had to compress it)
    Attached Files Attached Files

  2. #2
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,520

    Re: data management system using userform

    Give this a try

    Please Login or Register  to view this content.
    Thanks,
    Mike

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved.

  3. #3
    Forum Contributor
    Join Date
    05-06-2009
    Location
    Singapore
    MS-Off Ver
    Excel 2003
    Posts
    361

    Re: data management system using userform

    Hi Mike, Thank you for your reply.
    It worked however, when I clicked on TextBox 22, an error message "Compile error: Variable not defined" pops up in the code at TextBox 21, highlighting " i "
    at For i = 22 To 29

    Please help!
    Thank you

  4. #4
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,520

    Re: data management system using userform

    That is because you have Option Explicit at the very top of your Forms Module. Could comment it out at the top of your but I don't suggest that.

    What does it mean?
    Putting the "Option Explicit" statement at the top of a code module (which includes forms/modules/classes/...) forces you to declare all variables that you have used in that module, using Dim or similar.

    If you try to run your code when a variable hasn't been declared, it will be highlighted, and you will get a clear error: "Variable not defined"

    Why should I use it?
    You are probably thinking "errors are bad, I don't want that!", but this is actually a very good error - as it tells you about problems that are hard to spot otherwise.


    You need to declare i like this. After I did this, the debugger highlighted another part of your code Variable in not declared.
    Please Login or Register  to view this content.
    Last edited by mike7952; 04-26-2017 at 09:24 PM.

  5. #5
    Forum Contributor
    Join Date
    05-06-2009
    Location
    Singapore
    MS-Off Ver
    Excel 2003
    Posts
    361

    Re: data management system using userform

    Hi mike, thanks for the above explanation. Could you help me with the following problems please?

    In the following code, im trying to check if textbox21 is blank. if it is then stop the commandbutton from going further. And also, check if users missed out filling in any enabled textboxes after they key a number in textbox21. if there is, stop the code. Somehow i must have coded it wrongly as it does not proceed even though users corrected the mistakes after the prompt.

    Please Login or Register  to view this content.

  6. #6
    Forum Contributor
    Join Date
    05-06-2009
    Location
    Singapore
    MS-Off Ver
    Excel 2003
    Posts
    361

    Re: data management system using userform

    Hi mike, waiting for your expert advise

  7. #7
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,520

    Re: data management system using userform

    Give me a little bit, trying to clean up the code so I can tell what is going on.

  8. #8
    Forum Contributor
    Join Date
    05-06-2009
    Location
    Singapore
    MS-Off Ver
    Excel 2003
    Posts
    361

    Re: data management system using userform

    Thanks mike. I have uploaded the current version that we are working on. difference is the addition of more tabs, but shouldnt affect the problem that i have above
    Attached Files Attached Files

  9. #9
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,520

    Re: data management system using userform

    Here is your issue with TextBox21. You don't have to check if TextBox21 has a value twice. I was going thru and trying to cleaning some of your code up but I don't have the time right now. the macro.

    I suggest going thru your code and getting rid of Dimed objects, strings and ranges that you are not using within

    Please Login or Register  to view this content.
    Below are a few Codes I cleaned up inside of your Userform1.

    Please Login or Register  to view this content.

    Please Login or Register  to view this content.

    Please Login or Register  to view this content.

  10. #10
    Forum Contributor
    Join Date
    05-06-2009
    Location
    Singapore
    MS-Off Ver
    Excel 2003
    Posts
    361

    Re: data management system using userform

    Hi mike, thanks for tidying up my codes, really appreciate it. Being a novice, i cant help but just plug someone else's code in and see if it works without much consideration. Will work on improving it as i go along. Regarding this code

    Please Login or Register  to view this content.
    What i was hoping is that if users forget to key in the empty textboxes, the prompt appears (which it does) telling them which one they had missed out. And until they have filled in all required fields (based on what is the number they key in textbox21) the info should not go into the worksheet (which it does now). I tried adding a "Exit Sub" after Next j but it stalls the code there. How would you code it for that to work?

  11. #11
    Forum Contributor
    Join Date
    05-06-2009
    Location
    Singapore
    MS-Off Ver
    Excel 2003
    Posts
    361

    Re: data management system using userform

    Hi mike, hope i'm not interrupting your busy schedule, but was wondering if you can find time to help me on this. There are still alot more questions that i need answers to and i hope to finish this within the next month or so

  12. #12
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,520

    Re: data management system using userform

    Something like this, just add the exit sub

    Please Login or Register  to view this content.

  13. #13
    Forum Contributor
    Join Date
    05-06-2009
    Location
    Singapore
    MS-Off Ver
    Excel 2003
    Posts
    361

    Re: data management system using userform

    thanks mike. I have an issue with this part of the code

    Please Login or Register  to view this content.
    its supposed to add a -n to the back of the value in combobox8 and it should continue the sequence where it left off. For example, i select DVI-00001-001 in combobox8 and add 1 sample to it, the sample name should be DVI-00001-001-1. it works fine on the first run. but if users select DVI-00001-001 again and add 1 more sample to it, the sample name becomes DVI-00001-001-1-1 instead of DVI-00001-001-2. Can you help me with that please?

  14. #14
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,520

    Re: data management system using userform

    What procedure is that code in so I can see the whole code.

  15. #15
    Forum Contributor
    Join Date
    05-06-2009
    Location
    Singapore
    MS-Off Ver
    Excel 2003
    Posts
    361

    Re: data management system using userform

    Its in commandbutton6, just below the exit sub you posted earlier

    Please Login or Register  to view this content.
    Last edited by bqheng; 05-11-2017 at 08:58 AM.

  16. #16
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,520

    Re: data management system using userform

    Give this a try, you have so much going on its hard for me to tell if I'm coming or going. I suggest declaring all your variables and getting rid of the ones your not using.

    Please Login or Register  to view this content.
    Last edited by mike7952; 05-13-2017 at 12:23 PM.

  17. #17
    Forum Contributor
    Join Date
    05-06-2009
    Location
    Singapore
    MS-Off Ver
    Excel 2003
    Posts
    361

    Re: data management system using userform

    Hi mike, the code is not working as desired. It is adding to the wrong number. When i tried it on DVI-00004-001, it added DVI-00004-002 instead of DVI-00004-001-1. Can you please help me resolve that?

  18. #18
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,520

    Re: data management system using userform

    Try this, Remove the code for the Case Log Worksheet_Change event. Code is add in the Button click event for the Date and Time.

    Please Login or Register  to view this content.
    Last edited by mike7952; 05-14-2017 at 11:26 AM.

  19. #19
    Forum Contributor
    Join Date
    05-06-2009
    Location
    Singapore
    MS-Off Ver
    Excel 2003
    Posts
    361

    Re: data management system using userform

    Hi mike, sorry for such a late reply to your last post. I was trying my best to solve the problems on my own, and i have finally come down to one last problem that i am unable to solve.

    I have attached 2 workbooks. The codes inside are exactly the same. the difference is that 1 workbook only has 1 row of data while the other has more than 1 row. When you open the workbook with just 1 row data, you will see the error popping up. but it works fine if there is more than 1 row.

    this part of the code gets highlighted in Userform_Initialize

    Please Login or Register  to view this content.
    hope you can help me on this so that i can mark this thread as solved
    Last edited by bqheng; 07-29-2017 at 02:24 AM.

  20. #20
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,520

    Re: data management system using userform

    Try this

    Please Login or Register  to view this content.

  21. #21
    Forum Contributor
    Join Date
    05-06-2009
    Location
    Singapore
    MS-Off Ver
    Excel 2003
    Posts
    361

    Re: data management system using userform

    Thank you so much mike!

+ 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. HR Management System
    By sayacharming in forum Excel General
    Replies: 1
    Last Post: 10-01-2016, 06:15 AM
  2. Queue Management System
    By raiken20 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-12-2016, 10:22 AM
  3. Using Userform Listbox for data management/editing
    By JusticeEmpire in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-12-2016, 10:09 AM
  4. File Access System Management
    By laxmanann in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-17-2014, 10:22 AM
  5. Warehouse Management System
    By bar0ld in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-01-2011, 07:13 PM
  6. Stock Management System
    By chr.s in forum Excel General
    Replies: 3
    Last Post: 01-17-2011, 01:52 PM
  7. [SOLVED] Leave Management System
    By Alok Garg in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 01-11-2005, 06:06 AM

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