Expand|Select|Wrap|Line Numbers
- Private Sub cmdsave_Click()
- rs.Fields("Emp_id") = cmbempid.Text
- rs.Fields("Absent_date") = lbldate2.Caption//it shows here
- If optabsent.Value = True Then
- rs.Fields("Emp_status") = "absent"
- Else
- rs.Fields("Emp_status") = "latemark"
- End If
- If optapprove.Value = True Then
- rs.Fields("cneck_record") = 1
- Else
- rs.Fields("cneck_record") = 0
- End If
- rs.Fields("Leave_type") = txtlname.Text
- rs.Update
- cmdfirst.Enabled = True
- cmdlast.Enabled = True
- cmdnext.Enabled = True
- cmdprevious.Enabled = True
- cmdexit.Enabled = True
- cmdadd.Enabled = True
- cmdmodify.Enabled = True
- cmddelete.Enabled = True
- cmdcancel.Enabled = True
- End Sub
- Private Sub Form_Load()
- con.Open _
- "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=leave;Data Source=ABC"
- 'con.Execute "set nocount on"
- substring = "select* from muster"
- 'rs.CursorLocation = adUseServer
- 'rs.Open substring, con, adOpenStatic, adLockPessimistic
- With rs
- .CursorType = adOpenStatic
- .CursorLocation = adUseClient
- .LockType = adLockOptimistic
- .ActiveConnection = con
- 'Set .ActiveConnection = Nothing
- End With
- rs.Open substring
- 'con.Execute (substring),
- 'rs.CursorLocation = adUseServer
- substring1 = "select * from Employee"
- rs1.Open substring1, con, adOpenDynamic, adLockOptimistic
- lbldate2.Caption = Date
- substring3 = "select * from leave"
- rs2.Open substring3, con, adOpenDynamic, adLockOptimistic
- 'cmbempid.AddItem (Form1.txtempno.Text)
- Do While Not rs1.EOF
- cmbempid.AddItem rs1(0)
- rs1.MoveNext
- Loop
- substring4 = " select * from leave_taken"
- rs3.Open substring4, con, adOpenDynamic, adLockOptimistic
- Dim substring5 As String
- Dim int1 As Integer
- substring5 = "select distinct emp_id from muster where Leave_type like 'nil'"
- If rs.State = adStateOpen Then
- rs.Close
- End If
- rs.Open substring5, con, adOpenDynamic, adLockOptimistic
- 'int1 = CInt(Trim(substring5))
- If rs.BOF = False Or rs.EOF = False Then
- rs.MoveNext
- MsgBox "There are 'nil' employee leave type not consider are " & rs.Fields("Emp_id").Value
- End If
- Call getdata
- 'optabsent.Value = False
- End Sub
- Private Sub optabsent_Click()
- optapprove.Enabled = True
- optdisapp.Enabled = True
- 'optlatemark.Enabled = False
- 'If optabsent = True Then
- ' If optapprove = True Then
- ' txtletype.Visible = True
- ' txttotal.Visible = False
- 'Else
- ' txtletype.Text = "Nil"
- 'txttotal.Visible = True
- 'End If
- 'Else
- ' optapprove.Value = False
- ' optdisapp.Value = False
- ' txtletype.Visible = False
- 'End If
- End Sub