ReignEternal
New Member
- Joined
- Apr 11, 2021
- Messages
- 41
- Office Version
-
- 365
- Platform
-
- Windows
Hello,
I have a UserForm that I have a button that will delete a line item (after a line item is selected and then the delete button is pressed) that is password protected. This works just fine but when the password is entered, users can see the password. I would like to have the field masked. The lines in bold are the issue I am having. I've been reading through some of the forums here but they are suggesting to create a user form. Can i create a user form within a user form? Here is the most recent thread I was reading (VBA password request before sub starts)
I have a UserForm that I have a button that will delete a line item (after a line item is selected and then the delete button is pressed) that is password protected. This works just fine but when the password is entered, users can see the password. I would like to have the field masked. The lines in bold are the issue I am having. I've been reading through some of the forums here but they are suggesting to create a user form. Can i create a user form within a user form? Here is the most recent thread I was reading (VBA password request before sub starts)
VBA Code:
Private Sub cmdDelete_Click()
If Selected_List = 0 Then
MsgBox "No row has been selected for deletion!", vbOKOnly + vbInformation, "Edit"
Exit Sub
End If
[COLOR=rgb(0, 0, 0)][B] Dim ans As String[/B][/COLOR]
[B][COLOR=rgb(0, 0, 0)] ans = InputBox("Please Enter Password to Allow Deletion of Line Item!")
[/COLOR][/B]
[COLOR=rgb(0, 0, 0)][B] If ans = "BidSizzle" Then[/B][/COLOR]
Dim iRow As Long
If Selected_List = 0 Then
MsgBox "No row is selected.", vbOKOnly + vbInformation, "Delete"
Exit Sub
End If
Dim i As VbMsgBoxResult
i = MsgBox("Do you want to delete the selected record?", vbYesNo + vbQuestion, "Confirmation")
If i = vbNo Then Exit Sub
iRow = Application.WorksheetFunction.Match(Me.lstDatabase.List(Me.lstDatabase.ListIndex, 0), _
ThisWorkbook.Sheets("Database").Range("A:A"), 0)
Worksheets("Database").Unprotect "GoldStar"
ThisWorkbook.Sheets("Database").Rows(iRow).Delete
Worksheets("Database").Protect "GoldStar"
Call Reset
MsgBox "Selected record has been deleted!", vbOKOnly + vbInformation, "Deleted"
End If
End Sub