VbzCart/docs/archive/code/VBA/Form sfrmPackageItems: Difference between revisions
Jump to navigation
Jump to search
imported>Woozle (Created page with "<VB> Option Explicit Public Property Get PkgItem() As clsPackageItem If IsNull(Me.ID) Then Set PkgItem = Nothing Else Set PkgItem = clsPackageItems.Ite...") |
m (Woozle moved page VbzCart/VbzCart/archive/code/VBA/Form sfrmPackageItems to VbzCart/docs/archive/code/VBA/Form sfrmPackageItems without leaving a redirect: correct naming (was no way to import directly to this name)) |
||
(3 intermediate revisions by one other user not shown) | |||
Line 1: | Line 1: | ||
<VB> | [[File:vbzcart-MSAccess-sfrmPackages.png]] | ||
<syntaxhighlight lang=VB> | |||
Option Explicit | Option Explicit | ||
Public Property Get PkgItem() As clsPackageItem | Public Property Get PkgItem() As clsPackageItem | ||
Line 101: | Line 102: | ||
End With | End With | ||
End Sub | End Sub | ||
</ | </syntaxhighlight> |
Latest revision as of 01:53, 25 February 2024
File:Vbzcart-MSAccess-sfrmPackages.png
Option Explicit
Public Property Get PkgItem() As clsPackageItem
If IsNull(Me.ID) Then
Set PkgItem = Nothing
Else
Set PkgItem = clsPackageItems.Item(Me.ID)
End If
End Property
Public Function QtyNotPackedEver() As Variant
' ACTION: returns the quantity of the current item which hasn't yet been packed at all (before or after this package)
Dim objPkgItm As clsPackageItem
Dim objOrdItm As clsOrderItem
If ItemExists Then
Set objPkgItm = Me.PkgItem
If objPkgItm Is Nothing Then
QtyNotPackedEver = "new"
Else
If objPkgItm.WasOrdered Then
Set objOrdItm = objPkgItm.OrderItem
If objOrdItm Is Nothing Then
QtyNotPackedEver = "n/a"
Else
With objOrdItm
QtyNotPackedEver = .QtyOrd - .QtyDone
End With
End If
Else
QtyNotPackedEver = "n/a"
End If
End If
Else
QtyNotPackedEver = Null
End If
End Function
Public Function QtyNotYetPacked() As Variant
' ACTION: returns the quantity of the current item which had not been packed as of this package's timestamp
Dim objItem As clsPackageItem ' package item
If IsNull(Me.ID) Then
QtyNotYetPacked = Null
Else
Set objItem = Me.PkgItem
If objItem Is Nothing Then
QtyNotYetPacked = "n/a"
Else
With objItem
If .WasOrdered Then
QtyNotYetPacked = .QtyYetToPack
Else
QtyNotYetPacked = "sub"
End If
End With
End If
End If
End Function
Private Property Get ItemExists() As Boolean
ItemExists = Not IsNull(Me.ID)
End Property
Private Property Let Status(iText As String)
With Me.lblStatus
If iText = "" Then
.Visible = False
Else
.Caption = iText
.Visible = True
End If
End With
DoEvents
End Property
Private Sub btnPullItem_Click()
' ACTION: Allow user to select quantity to pull and location to pull from.
Dim objPLine As clsPackageItem
Set objPLine = clsPackageItems.Item(Me.ID)
With clsForms.Dlg_SelectLocation_andQty
.Item_ID = Me.ID_Item
Do
If .doFetch("select location and quantity") Then
objPLine.FetchFromLocation .Location, .Qty
Status = .Qty & " items fetched; " & objPLine.QtyShipped & " items in pkg to ship"
Me.Requery
End If
Loop Until .isDone
End With
Status = ""
End Sub
Private Sub cbxItem_DblClick(Cancel As Integer)
clsForms.ItemView.Locate Me.cbxItem
End Sub
Private Sub Form_Resize()
Dim glWd As Single
With Me.editNotes
glWd = Me.InsideWidth - .Left - 300
If glWd > 0 Then
.Width = glWd
Me.Width = .Width
End If
End With
End Sub