+ Reply to Thread
Results 1 to 11 of 11

Userform for data entry

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

    Userform for data entry

    Hi, I have a userform where staff will go into "Add case" tab to enter data. After selecting Sample Type, entering Marking and Mortuary No, they will click "Add". This command will add the data into textbox16. One problem here is that the "Case assigned" number should remain as "DVI-00001" if "Add" command is clicked, such that the next data added into textbox16 will have "DVI-00001-002". The "Case assigned" number should change to "DVI-00002-001" if the "Prelog" command is clicked. I'm having problems trying to make that happen.

    Staff will carry on adding to the textbox based on how much data there is, after which, they will click Prelog. This command will add the data into the worksheet. I'm having problems trying to get the data from textbox16 into the worksheet. The data needs to be split into the respective rows and columns according to the same heading.

    Any help is appreciated
    Last edited by bqheng; 10-05-2016 at 09:37 PM.

  2. #2
    Forum Expert millz's Avatar
    Join Date
    08-14-2013
    Location
    Singapore
    MS-Off Ver
    Excel, Access 2016
    Posts
    1,694

    Re: Userform for data entry

    Your requirements are not entirely clear, but give these changes a try and let me know how it goes.

    Form initialize code:
    Please Login or Register  to view this content.
    Add button code:
    Please Login or Register  to view this content.
    Prelog button code:
    Please Login or Register  to view this content.
    多么想要告诉你 我好喜欢你

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

    Re: Userform for data entry

    Hi millz, thank you for your help. The "Add" command has been resolved thanks to your code. The "Prelog" button still needs working on, due to my unclear description. When this button is clicked, the information in textbox16 should populate into the worksheet as follows:
    Case: DVI-00001-001 Sample Type: Bone Marking: 1234 Mortuary ID: M1234
    Case: DVI-00001-002 Sample Type: Body part Marking: 1235 Mortuary ID: M1235

    Hope this helps

  4. #4
    Forum Expert millz's Avatar
    Join Date
    08-14-2013
    Location
    Singapore
    MS-Off Ver
    Excel, Access 2016
    Posts
    1,694

    Re: Userform for data entry

    Try these changes:
    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    Edit:
    It will not populate properly if you choose "Body Part", since it contains a space.
    You can try a different column separator, like underscore ( _ )
    or revamp your form and use multi-column listbox instead of a multi-line textbox.
    Last edited by millz; 09-28-2016 at 03:15 AM.

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

    Re: Userform for data entry

    I tried the codes and got an invalid or unqualified reference on this line in red

    Please Login or Register  to view this content.

  6. #6
    Forum Expert millz's Avatar
    Join Date
    08-14-2013
    Location
    Singapore
    MS-Off Ver
    Excel, Access 2016
    Posts
    1,694

    Re: Userform for data entry

    You need the With statement block, don't remove them.
    Please Login or Register  to view this content.

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

    Re: Userform for data entry

    Oh silly me... Thanks for correcting. I attached a revised version of the previous workbook. After users have filled in info, clicked "Add" and clicked "Receive in lab", how do I code the "transfer custody" button such that what is in textbox16 will have the correct custodian? example:
    Textbox16 has these info
    Case: DVI-00001-001 Sample Type: Bone Marking: 1234 Mortuary ID: M1234
    Case: DVI-00001-002 Sample Type: Body part Marking: 1235 Mortuary ID: M1235
    Clicking "Receive in Lab" will transfer these info into respective columns in worksheet. Column E will be populated with textbox14.
    Now users need to transfer the custody to another person or location. They do so by selecting from combobox5 and click "Execute". Column F should populate the new custodian for DVI-00001-001 and DVI-00001-002
    Last edited by bqheng; 10-05-2016 at 09:38 PM.

  8. #8
    Forum Expert millz's Avatar
    Join Date
    08-14-2013
    Location
    Singapore
    MS-Off Ver
    Excel, Access 2016
    Posts
    1,694

    Re: Userform for data entry

    Try this change:

    Please Login or Register  to view this content.

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

    Re: Userform for data entry

    Thanks millz. Next question: In the "Case manager" tab, how do I get combobox2 to populate the cases that are entered in column A, without repetitions? And after selecting the case number from the combobox, how do I get data from columns C to H into textbox18 for that particular case?

  10. #10
    Forum Expert millz's Avatar
    Join Date
    08-14-2013
    Location
    Singapore
    MS-Off Ver
    Excel, Access 2016
    Posts
    1,694

    Re: Userform for data entry

    Hi, you are deviating further from the original topic with subsequent problems/questions.

    I suggest closing this thread and opening a new one with your new problem. Fresh threads usually get help faster, and possibly better solutions too.

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

    If you think that I could be of help, you can PM me a link to your new thread containing the new question, and I will take a look when time permits.

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

    Re: Userform for data entry

    sorry about that millz. will start a new thread. Thanks

+ 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. Userform data entry
    By stevipop in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-27-2014, 04:12 PM
  2. userform and data entry help
    By andrewode in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-11-2014, 11:30 AM
  3. Replies: 0
    Last Post: 02-04-2014, 12:36 AM
  4. Userform data entry
    By amekock in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 09-19-2011, 10:26 AM
  5. Data entry using a userform
    By j_Southern in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-04-2010, 08:59 PM
  6. UserForm for data entry
    By jay11 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-15-2010, 03:30 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