H
hisham
I want to combine code 3 button to 1 button.
Pls help me how to combine. Below is coding for 3 button.
*************************************************
Private Sub Command23_Click()
Dim dbs As Database, rst As Recordset
Dim strSelect As String
Set dbs = CurrentDb
strSelect = "SELECT * FROM P1ENTRY"
Set rst = dbs.OpenRecordset(strSelect)
Do While Not rst.EOF
rst.Edit
If rst![Item1] = rst![Item2] Then
rst![StatusItem] = "0"
Else
rst![StatusItem] = "1"
End If
rst.Update
rst.MoveNext
Loop
rst.close
MsgBox ("Checking for item done!!!")
End Sub
Private Sub Command24_Click()
Dim dbs As Database, rst As Recordset
Dim strSelect As String
Set dbs = CurrentDb
strSelect = "SELECT * FROM P1ENTRY"
Set rst = dbs.OpenRecordset(strSelect)
Do While Not rst.EOF
rst.Edit
If rst![Qty1] = rst![Qty2] Then
rst![StatusQty] = "0"
Else
rst![StatusQty] = "1"
End If
rst.Update
rst.MoveNext
Loop
rst.close
MsgBox ("Checking for quantity done!!!")
End Sub
Private Sub Command25_Click()
Dim dbs As Database, rst As Recordset
Dim strSelect As String
Set dbs = CurrentDb
strSelect = "SELECT * FROM P1ENTRY"
Set rst = dbs.OpenRecordset(strSelect)
Do While Not rst.EOF
rst.Edit
If rst![UoM1] = rst![UoM2] Then
rst![StatusUoM] = "0"
Else
rst![StatusUoM] = "1"
End If
rst.Update
rst.MoveNext
Loop
rst.close
MsgBox ("Checking for UoM done!!!")
End Sub
Pls help me how to combine. Below is coding for 3 button.
*************************************************
Private Sub Command23_Click()
Dim dbs As Database, rst As Recordset
Dim strSelect As String
Set dbs = CurrentDb
strSelect = "SELECT * FROM P1ENTRY"
Set rst = dbs.OpenRecordset(strSelect)
Do While Not rst.EOF
rst.Edit
If rst![Item1] = rst![Item2] Then
rst![StatusItem] = "0"
Else
rst![StatusItem] = "1"
End If
rst.Update
rst.MoveNext
Loop
rst.close
MsgBox ("Checking for item done!!!")
End Sub
Private Sub Command24_Click()
Dim dbs As Database, rst As Recordset
Dim strSelect As String
Set dbs = CurrentDb
strSelect = "SELECT * FROM P1ENTRY"
Set rst = dbs.OpenRecordset(strSelect)
Do While Not rst.EOF
rst.Edit
If rst![Qty1] = rst![Qty2] Then
rst![StatusQty] = "0"
Else
rst![StatusQty] = "1"
End If
rst.Update
rst.MoveNext
Loop
rst.close
MsgBox ("Checking for quantity done!!!")
End Sub
Private Sub Command25_Click()
Dim dbs As Database, rst As Recordset
Dim strSelect As String
Set dbs = CurrentDb
strSelect = "SELECT * FROM P1ENTRY"
Set rst = dbs.OpenRecordset(strSelect)
Do While Not rst.EOF
rst.Edit
If rst![UoM1] = rst![UoM2] Then
rst![StatusUoM] = "0"
Else
rst![StatusUoM] = "1"
End If
rst.Update
rst.MoveNext
Loop
rst.close
MsgBox ("Checking for UoM done!!!")
End Sub