'------------------------
' Asset List
'------------------------
Option Compare Database
Dim sel As String
Private Sub btnNew_Click()
If IsNull(Me.List.Column(0)) Then
MsgBox "ÇáÑÌÇÁ ÇÎÊíÇÑ ÓÌá ÓíÇÑÉ ãä ÇáÞÇÆãÉ ÇáÚáíÇ¡ áÅÖÇÝÉ ÓÌá ÊÓáíã áåÇ", vbInformation, "Family tree"
Else
DoCmd.OpenForm "frmCharityService", , , "[ID]= " & Me.List.Column(3)
End If
End Sub
Private Sub Command22_Click()
Dim AssetList As String
If Me.Select = 1 Then
sel = "(((tblFullName_temp.FullName) Like '*" & Me.Input & "*'))" 'check16
ElseIf Me.Select = 2 Then
sel = "(((tblFullName_temp.FullAlterID) Like '*" & Me.Input & "*'))" 'check18
'ElseIf Me.Select = 3 Then
' sel = "CarModle like '*" & Me.Input & "*'" 'check26
'ElseIf Me.Select = 4 Then
' sel = "CarPlateNumber like '*" & Me.Input & "*'" 'check28
'ElseIf Me.Select = 5 Then
' sel = "(((tblFullName_temp.Sex) Like '*" & Me.Input & "*'))" 'check31
'
End If
AssetList = "SELECT tblFullName_temp.ID, tblFullName_temp.FullName as [ÇáÇÓã], tblFullName_temp.FullAlterID as [ÇáÑãÒ], " & _
" tblFullName_temp.EmpID, tblFullName_temp.Sex FROM tblFullName_temp " & _
"WHERE " & sel & " ;"
Me.List.RowSource = AssetList
Me.List.ColumnCount = 8
Me.List.ColumnHeads = True
'Me.List.ColumnWidths = "3 cm; 6 cm; 3 cm; 3 cm; 5 cm"
End Sub
Private Sub Command23_Click()
Call ViewAll
End Sub
Private Sub Form_Activate()
strForm = "frmCharityServiceList"
Refresh
DoCmd.Restore
If IsOpen(frmMemberPhoto) = True Then
Forms!frmMemberPhoto.dum
End If
If IsOpen("frmMemberPhoto") = False Then
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmMemberPhoto"
' stLinkCriteria = "[ID]= " & Me.List.Column(10)
DoCmd.OpenForm stDocName, , , stLinkCriteria
' DoCmd.OpenForm "frmCarPhoto", , , "[ID]= " & Me.List.Column(10)
End If
End Sub
Private Sub Form_Deactivate()
DoCmd.Minimize
End Sub
Private Sub Form_Open(Cancel As Integer)
Call ViewAll
End Sub
Private Sub Command6_Click()
On Error GoTo Err_Command6_Click
Call SecondList_DblClick(False)
Exit_Command6_Click:
Exit Sub
Err_Command6_Click:
MsgBox err.Description
Resume Exit_Command6_Click
End Sub
Private Sub List_Click()
Me.ID.Value = Me.List.Column(3)
'Me.SecondList = Me.List.Column(3)
lngMemberID = Me.ID
Me.SecondList = 0
Me.ID2 = 0
Me.SecondList.Requery
If IsOpen("frmMemberPhoto") = True Then
Forms!frmMemberPhoto.dum
End If
End Sub
Private Sub ViewAll()
Dim AssetList As String
AssetList = "SELECT tblFullName_temp.ID, tblFullName_temp.FullName as [ÇáÇÓã], tblFullName_temp.FullAlterID as [ÇáÑãÒ], " & _
" tblFullName_temp.EmpID, tblFullName_temp.Sex FROM tblFullName_temp ORDER BY [SortID] DESC;"
Me.List.RowSource = AssetList
Me.List.ColumnCount = 5
Me.List.ColumnHeads = True
'Me.List.ColumnWidths = "3 cm; 6 cm; 3 cm; 3 cm; 5 cm"
End Sub
Private Sub Command24_Click()
On Error GoTo Err_Command24_Click
If IsOpen("frmMemberPhoto") = True Then
DoCmd.Close acForm, "frmMemberPhoto", acSaveYes
End If
DoCmd.Close
Exit_Command24_Click:
Exit Sub
Err_Command24_Click:
MsgBox err.Description
Resume Exit_Command24_Click
End Sub
Private Function DeleteItem(lngID2 As Long)
Dim strFindCriterea As String
Dim cnnLocal As New ADODB.Connection
Dim rsttblCharityServices As New ADODB.Recordset
Set cnnLocal = CurrentProject.Connection
rsttblCharityServices.Open "tblCharityServices", cnnLocal, adOpenDynamic, adLockPessimistic
rsttblCharityServices.Find "ID = " & lngID2
rsttblCharityServices.Delete
rsttblCharityServices.Close
cnnLocal.Close
End Function
Private Sub btnDelete_Click()
If Not IsNull(Me.ID2.Value) And Not Me.ID2.Value = 0 Then
Dim response
response = MsgBox("¿åá ÊÑíÏ ÍÐÝ ÇáÓÌá", vbYesNo + vbInformation + vbDefaultButton2, "Confirm Save")
If response = vbYes Then
Call DeleteItem(Me.ID2.Value)
Me.SecondList.Requery
Me.ID2 = 0
'Me.lstEmp = Null
End If
Else
MsgBox "áã ÊÞã ÈÇÎÊíÇÑ ÓÌá ãä ÇáÞÇÆãÉ áÍÐÝÉ"
End If
End Sub
Private Sub SecondList_Click()
Me.ID2.Value = Me.SecondList.Value
End Sub
Private Sub SecondList_DblClick(Cancel As Integer)
If IsNull(Me.SecondList.Column(1)) Then
MsgBox "Please select a record from the list", vbInformation, "Palace Garage"
Else
' åäÇ íÌÈ æÖÚ ÞÑÇÁÉ áãáÝ ÇáÊÓáíã æÇáÇÓÊáÇ ÈÑÞã ÇáãÚÑÝ ááÓíÇÑÉ¡ ÅÐÇ æÌÏ ÓÌáÇ íÍÖÑ ÂÎÑ ÓÌá ÍÓÈ ÇáÊÇÑíΡ æÅÐÇ áã íÌÏ ÓÌáÇÊ ÝÅäå íÝÊÍ ÇáäãæÐÌ ÈæÖÚ ÓÌá ÌÏíÏ
DoCmd.OpenForm "frmCharityServiceChange", , , "[ID]= " & Me.SecondList.Column(1)
End If
End Sub
|