PDA

View Full Version : Update spreadsheet via Form



Emoncada
01-18-2008, 02:37 PM
I have this form that I would like to see how I can make it work.
I would like for when someone clickes one of the "Electonic Signature" Buttons I would show the form "FrmSignOff" Then the person would pick there name and enter there password in the TxtBox "TxtPassword" Then hit the SignOff Button "CmdSignOff" and if the name matches the password then there name goes into the cell below the "Electonic Signature" button that was pressed.

Emoncada
01-18-2008, 04:36 PM
Ok I came up with this code which seems to work only thing I don't know how i can assign the cmdbuttons on the spreadsheet to connect with the cells.

Private Sub CmdSignOff_Click()
Dim res As String, res2 As String, ns As String
res = TxtPassword.Value

If ButtonSStuart.Value = True Then
res2 = "help"

ns = "Sherry Stuart"

End If
If ButtonEThomas.Value = True Then
res2 = "abcd"

ns = "Edwin Thomas"

End If
If res = res2 Then
Range("B10").Value = ns
End If
If res <> res2 Then
If MsgBox("Invalid Password! Would You Like To Retry", vbYesNo, "Password Error") = vbYes Then
FrmSignOff.TxtPassword.SetFocus

Else
FrmSignOff.Hide
End If

End If
End Sub

Emoncada
01-19-2008, 07:01 AM
Ok I made it work by creating a form for each cmdbutton and attaching a cell to each form. I hope there is a way to accomplish this with just one form. Any ideas?