Hi Expert, my Option1.value is not save to databse while Option2.value is saving. Pls help me check my code. Thanks
Private Sub cmdSave_Click()
Set rs = New ADODB.Recordset
rs.Open "select*from Employees", cn, adOpenKeyset, adLockOptimistic
On Error GoTo err
rs.AddNew
rs!Employees_IdNo = txtSearch1.Text
rs!Lastname = txtLastname1.Text
rs!Firstname = txtFirstname1.Text
rs!Middle_Initial = txtMiddle_Initial1.Text
rs!Address = txtAddress1.Text
rs!Birthdate = DTPickerBirthdate1
rs!Date_Hired = DTPickerDate_Hired1
rs!Position = cboPosition.Text
rs!Rate = lblRate.Caption
rs!Civil_Status = cboCivil_Status1.Text
rs!Contact_No = txtContact_No1.Text
rs!Tin_No = txtTin_No1.Text
rs!SSS_No = txtSSS_No1.Text
rs!Philhealth_No = txtPhilhealth_No1.Text
rs!Pagibig_No = txtPagibig_No1.Text
rs!Remarks = txtRemarks1.Text
If Option1.Value = True Then
Option1.Caption = "Female"
rs!Gender = Option1.Caption
ElseIf Option2.Value = True Then
Option2.Caption = "Male"
rs!Gender = Option2.Caption
rs.Update
rs.Close
MsgBox "Saved.", vbInformation, "Employee"
Set rs = Nothing
Form03.clear
End If
Exit Sub
err:
MsgBox "The ID number is already exist. Enter new number.", vbExclamation, "Employee"
End Sub