+ Reply to Thread
Results 1 to 15 of 15

VBA Help need to show the employees details in userform.

  1. #1
    Forum Contributor
    Join Date
    10-30-2011
    Location
    Doha
    MS-Off Ver
    MS office 365
    Posts
    701

    Question VBA Help need to show the employees details in userform.

    Folks,

    I have a workbook with Employee details data sheet. And, I have built two userforms to search and view the employee’s full details. I don’t know how to link the row source for combobox and textbox.
    I have attached the excel file of what I'm trying to accomplish.

    Thanks in advance for your expertise!

    Joshi
    Attached Files Attached Files

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

    Re: VBA Help need to show the employees details in userform.

    Have a look at attached for starters.
    Attached Files Attached Files

  3. #3
    Forum Contributor
    Join Date
    10-30-2011
    Location
    Doha
    MS-Off Ver
    MS office 365
    Posts
    701

    Re: VBA Help need to show the employees details in userform.

    Hi creytroy,

    Thanks for your reply. But some issues, in combobox2 duplicated records should not appear, also no records is not showing in combobox3. Please help me someone?

    Thanks in advance,
    Joshi

  4. #4
    Forum Contributor
    Join Date
    10-30-2011
    Location
    Doha
    MS-Off Ver
    MS office 365
    Posts
    701

    Re: VBA Help need to show the employees details in userform.

    Hi Folks,

    Help me please?

    Thanks in advance,
    Joshi

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

    Re: VBA Help need to show the employees details in userform.

    No time to do any more at present.

    But have a look thus far.
    Attached Files Attached Files

  6. #6
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,167

    Re: VBA Help need to show the employees details in userform.

    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  7. #7
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: VBA Help need to show the employees details in userform.

    Hi,

    I am working on a different approach but a few questions:

    1) Does the user have to fill all three comboxes or can they pick and choose?

    2) If they have to pick all three (or any specific number) is there an order (e.g. 1 >> 2 >> 3) or can they for example choose a country then title name.

    abousetta
    Please consider:

    Thanking those who helped you. Click the star icon in the lower left part of the contributor's post and add Reputation.
    Cleaning up when you're done. Mark your thread [SOLVED] if you received your answer.

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

    Re: VBA Help need to show the employees details in userform.

    It has been set to us all 3 items, starting from 1- 3.

  9. #9
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: VBA Help need to show the employees details in userform.

    Have a look at the attachment. I think it satisfies all your requirements and has a few safeguards built in along the way.

    abousetta
    Attached Files Attached Files

  10. #10
    Forum Contributor
    Join Date
    10-30-2011
    Location
    Doha
    MS-Off Ver
    MS office 365
    Posts
    701

    Question Re: VBA Help need to show the employees details in userform.

    Hi abousetta ,

    Thanks for your codes and its working great. But I need some slight modification.
    1) I want to protect the "Data_Base" sheet by giving password "SDG123" and hide (xlveryhidden).
    2) I want to show the userforms in "Search" Sheet not in the "Data_Base" sheet.
    3) I have added a command button "Edit or add new data" on UserFrom1 to edit or add new data in "Data_Base" sheet, when I hit the button should show MsgBox("Do you really want to edit data?", vbYesNo), if vbYes then unhide and unprotect the "Data_Base" sheet with password "SDG123", if wrong password entered MsgBox("Incurrect Password"), if vbNo nothing to do.

    I was trying to do the same and added some codes, but unable to fix it. See the attached modified file.
    Thanks in advance for your expertise!

    Joshi
    Attached Files Attached Files

  11. #11
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: VBA Help need to show the employees details in userform.

    Hi,

    In this post, I show how to use hide a sheet using xlveryhidden and opening it with a password. Also there are two options (one for activeX and regular vba). You should be able to adapt the code to your needs.

    Let me know if you still have problems.

    abousetta

  12. #12
    Forum Contributor
    Join Date
    10-30-2011
    Location
    Doha
    MS-Off Ver
    MS office 365
    Posts
    701

    Re: VBA Help need to show the employees details in userform.

    Hi abousetta,

    Thanks for your reply and I could mange to protect, hide and unhide the sheet with your codes. But I am unable to use the userform1 in "Search" Sheet, the userform1 showing without any data if I open the userform1 thru "Search" sheet.

    Can you please look at the attached workbook and advise to fix the issue.

    Thanks,
    Joshi
    Attached Files Attached Files
    Last edited by krjoshi; 12-04-2012 at 12:56 PM.

  13. #13
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: VBA Help need to show the employees details in userform.

    Hi,

    Minor tweaks:

    Please Login or Register  to view this content.
    Tested it and works fine now.

    abousetta
    Last edited by abousetta; 12-05-2012 at 03:50 AM.

  14. #14
    Forum Contributor
    Join Date
    10-30-2011
    Location
    Doha
    MS-Off Ver
    MS office 365
    Posts
    701

    Question Re: VBA Help need to show the employees details in userform.

    HI abousetta,

    Still having some issues. Please note that the record is not changing or updating in userform2 based on userform1 search criteria.

    Please see the attached workbook.

    Thanks in advance.

    Joshi
    Attached Files Attached Files

  15. #15
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: VBA Help need to show the employees details in userform.

    I am uploading the version I have and I am not able to recreate your problem. Have a look.

    What I would recommend is replacing the textboxes in form2 with labels. That way the user can see them easier and also select and copy them.

    abousetta
    Attached Files Attached Files

+ 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