Kristen_cancerkiller
Member
I am down to the last piece of my excel document that I am creating. I have a userform which is to be used by up to 3 people to provide electronic signatures. The intention is that one button on the excel document will open one userform but each of 3 different people will need to use it to approve the document at 3 different times. When the employee enters the userform, they enter their name and date and then check the checkbox that says 'I approve'. These pieces of information are then moved to the employee fields on the excel document. The employee sends the document to their supervisor and the supervisor reviews and does the same in the 'supervisor' fields. They enter their name and date and check the 'I approve' checkbox in the supervisor section. This moves the supervisor name, the date and the supervisor's computer name and username to the excel document. And on to the higher supervisor if needed (the supervisor will know if it is needed to go higher than themselves). I am attaching a screenshot of the userform for reference as well as the excel document fields where these pieces of info should go.
What I am experiencing is that I can test and enter all 3 approval information into the userform and it will transfer all info to the excel document. However, if I enter only the employee, the employee info is going to the excel document but if I go back in and enter the info as the supervisor, only the computer name and computer username is going to my excel document, and the same is happening with the 3rd approval as well. Could someone please tell me what I need to do differently to make this work appropriately? My code is below:
What I am experiencing is that I can test and enter all 3 approval information into the userform and it will transfer all info to the excel document. However, if I enter only the employee, the employee info is going to the excel document but if I go back in and enter the info as the supervisor, only the computer name and computer username is going to my excel document, and the same is happening with the 3rd approval as well. Could someone please tell me what I need to do differently to make this work appropriately? My code is below:
Code:
Private Sub SignatureForm()
frmSignature.Show
End Sub
Public Sub chkEmployee_click()
Dim ComputerName, UserName As String
'Getting computer name
ComputerName = Environ("computername")
'Getting user name
UserName = Environ("username")
'''BEGIN DATA MOVE INTO DATABASE'''
Sheets("Travel Expense Voucher").Range("EEDate").Value = txtEEDate
Sheets("Travel Expense Voucher").Range("EEName").Value = txtEEName
Sheets("Travel Expense Voucher").Range("EECompName").Value = ComputerName
Sheets("Travel Expense Voucher").Range("EECompUName").Value = UserName
End Sub
Public Sub chkSupervsr_click()
Dim ComputerName, UserName As String
'Getting computer name
ComputerName = Environ("computername")
'Getting user name
UserName = Environ("username")
'''BEGIN DATA MOVE INTO DATABASE'''
Sheets("Travel Expense Voucher").Range("ORDate").Value = txtEEDate
Sheets("Travel Expense Voucher").Range("ORName").Value = txtEEName
Sheets("Travel Expense Voucher").Range("ORCompName").Value = ComputerName
Sheets("Travel Expense Voucher").Range("ORCompUName").Value = UserName
End Sub
Public Sub chkDO_click()
Dim ComputerName, UserName As String
'Getting computer name
ComputerName = Environ("computername")
'Getting user name
UserName = Environ("username")
'''BEGIN DATA MOVE INTO DATABASE'''
Sheets("Travel Expense Voucher").Range("DODate").Value = txtEEDate
Sheets("Travel Expense Voucher").Range("DOName").Value = txtEEName
Sheets("Travel Expense Voucher").Range("DOCompName").Value = ComputerName
Sheets("Travel Expense Voucher").Range("DOCompUName").Value = UserName
End Sub
Public Sub cmdSigsSubmit_Click()
'When submit button is clicked
Unload frmSignature
End Sub