Private Sub ADDorREMOVE_Click()
Dim Weight As Long
Dim strLotNo As String
Dim strGrade As String
Private Sub ADDorREMOVE_Click()
Dim Weight As Long
Dim strLotNo As String
Dim strGrade As String
Dim intRecID As Long
Dim Wt2Add2 As Long
Dim WeightCharge As Long
If IsNull(List1.Column(0)) Or IsEmpty(List1.Column(0)) Then
MsgBox "Select an item first", vbCritical, "No item selected"
Exit Sub
End If
intRecID = List1.Column(0)
strLotNo = List1.Column(1)
strGrade = List1.Column(2)
Weight = List1.Column(3)
If IsNull(Me!Wt2Add2) Or IsEmpty(Me!Wt2Add2) Then
MsgBox "Please enter the weight you wish to add"
Exit Sub
End If
If Me!Wt2Add2 = Weight Then
List2.AddItem Item:=(((intRecID & ";" & strLotNo & ";" & strGrade & ";" & Weight)))
ElseIf Me!Wt2Add2 - Weight > 0 Then
MsgBox ("You have entered a weight bigger than what we have in stock. Please re-enter lower weight")
ElseIf Me!Wt2Add2 - List1.Column(3) < 0 Then
WeightCharge = ((List1.Column(3)) - Me!Wt2Add2)
List2.AddItem Item:=(((intRecID & ";" & strLotNo & ";" & strGrade & ";" & WeightCharge)))
End If
'List1.RemoveItem
ADDorREMOVE_Click_Exit:
Exit Sub
Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.
When asked, what has been your best career decision?
Deciding to stick with EE.
Being involved with EE helped me to grow personally and professionally.
Connect with Certified Experts to gain insight and support on specific technology challenges including:
We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE