Welcome to Dream.In.Code
Getting VB Help is Easy!

Join 136,544 VB Programmers for FREE! Get instant access to thousands of VB experts, tutorials, code snippets, and more! There are 1,857 people online right now. Registration is fast and FREE... Join Now!




Displaying info from xls on userform

 
Reply to this topicStart new topic

Displaying info from xls on userform, user permissions

ALVINCHAAND
21 Aug, 2008 - 01:11 PM
Post #1

New D.I.C Head
*

Joined: 17 Aug, 2008
Posts: 18

Hi,
I have 2 workbooks. wkbk1 with various surnames and countries...
wkbk2 with detailed info on those people...eg tel address dateofbirh etc

I have 2 types of users accessing these workbks. Admin who has the rights to search, view and Update
AND user who can only search and view

Now how do i acheive the following:

1- when a user/admin does a SEARCH by surname & country of origin,how do i call the data from wkbk1 to be viewed in a userform according to search matches in a drop down menu??

2-allow the sharing of the same wkbks between users n admin but allow only the admin to be able to edit and update info?

Any help will be greatly appreciated! Thank you in advance for any help rendered.
User is offlineProfile CardPM
+Quote Post

PsychoCoder
RE: Displaying Info From Xls On Userform
21 Aug, 2008 - 02:00 PM
Post #2

using DIC.Core;
Group Icon

Joined: 26 Jul, 2007
Posts: 8,997



Thanked: 125 times
Dream Kudos: 8625
Expert In: VB, VB.Net, C#, SQL, ASP, ASP.Net, Web Development, HTML, CSS, Win32 API, Javascript, mySQL, J#, Boo.Net

My Contributions
Dream.In.Code has a policy by which we prefer to see a good faith effort on your part before providing source code for homework assignments. Please post the code you have written in an effort to resolve the problem, and our members would be happy to provide some guidance. Be sure to include a description of any errors you are encountering as well.

Please post like this:

Thank you for helping us helping you.
User is online!Profile CardPM
+Quote Post

ALVINCHAAND
RE: Displaying Info From Xls On Userform
22 Aug, 2008 - 02:26 AM
Post #3

New D.I.C Head
*

Joined: 17 Aug, 2008
Posts: 18

QUOTE(PsychoCoder @ 21 Aug, 2008 - 03:00 PM) *

Dream.In.Code has a policy by which we prefer to see a good faith effort on your part before providing source code for homework assignments. Please post the code you have written in an effort to resolve the problem, and our members would be happy to provide some guidance. Be sure to include a description of any errors you are encountering as well.

Please post like this:

Thank you for helping us helping you.

Hi,
I have 2 workbooks. wkbk1 with various surnames and countries...
wkbk2 with detailed info on those people...eg tel address dateofbirh etc

I have 2 types of users accessing these workbks. Admin who has the rights to search, view and Update
AND user who can only search and view

Now how do i achieve the following:

1- when a user/admin does a SEARCH by surname & country of origin,how do i call the data from wkbk1 to be viewed in a userform according to search matches in a drop down menu?? EG SHOW items from the wkbk1 "SINGAPORE_TAN.xls sheet which holds all the full names of TAN(surnamed pple)

EG when user selects the particular tan he wants to view EG selects tan maylee , he is directed to the "SINGAPORE_TAN_MAYLEE.xls" and is able to view the data

when the admin does the same...as in when he selcts Tan Maylee he is shown a prompt where he can choose to update the items displayed via a userform which updates the SINGAPORE_TAN_MAYLEE.xls sheet.
2-allow the sharing of the same wkbks between users n admin but allow only the admin to be able to edit and update info?

Any help will be greatly appreciated! Thank you in advance for any help rendered.
[code]
Private Sub CMD_MM_Click()
Unload Me
1_MAIN_MENU.Show
End Sub

Private Sub COORIGIN_COMBO_Click()
COORIGIN_COMBO.DropDown 'takes value from sheet1 in excel spreadsheet.-->rowsource
End Sub

Private Sub SN_COMBO_CLICK()
SN_COMBO.DropDown 'takes value from sheet1 in excel spreadsheet.-->rowsource
End Sub

Private Sub CMD_SEARCH_Click()
'to allow the search button to match criteria with that available in DB
'Sheets("SINGAPORE_LIM").Select 'TO OPEN THIS PARTICULAR SHEET IF SEARCH CRITERIA MATCHED
Unload Me

'Check if user left it blank
If Me.SN_COMBO.Value = "" Then
MsgBox "Please select the SURNAME", vbExclamation
Me.SN_COMBO.SetFocus
Exit Sub
End If

'Check if user left it blank
If Me.COORIGIN_COMBO.Value = "" Then
MsgBox "Please select the Country of Origin", vbExclamation
Me.COORIGIN_COMBO.SetFocus
Exit Sub
End If

'IF POSSIBLE CALL DATA FROM XLS AND DISPLAY IN DATA VIEW USERFORM...

'if criteria matches the following then open the particular spreadsheet
If SN_COMBO.Value = "LIM" And COORIGIN_COMBO.Value = "SINGAPORE" Then
Sheets("SINGAPORE_LIM").Select
End If

If SN_COMBO.Value = "TAN" And COORIGIN_COMBO.Value = "SINGAPORE" Then
Sheets("SINGAPORE_TAN").Select
End If

If SN_COMBO.Value = "SINGH" And COORIGIN_COMBO.Value = "INDIA" Then
Sheets("INDIA_SINGH").Select
End If

If SN_COMBO.Value = "CHABBRA" And COORIGIN_COMBO.Value = "INDIA" Then
Sheets("INDIA_cHABBRA").Select
End If


End Sub









User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 12/2/08 10:52PM

Live VB Help!

VB Tutorials

Reference Sheets

VB Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month