$type=three$count=9$h=250$space=0$icon=1$m=0$sn=0$rm=0

Recent Aploaded Videos

Follow Me on Creative Fabrica

Complete inventory management system | 24

SHARE:

Welcome again to our tutorial, the last tutorial we saw the way to save and restrict some data in our Complete inventory management system

 Complete inventory management system | 24

Welcome again to our tutorial, the last tutorial we saw the way to save and restrict some data in our Complete inventory management system. In this tutorial, we have demonstrated the code and illustrated the meaning of each line with the respective code on it. 

the image below shows the part we have learned in this tutorial, each part has a number which will be illustrated respectively.

Complete inventory management system
Afya C System Database

Combo Box and Add Items (1)

As the picture above shows number one comprises the combo box and a button (Add Items). As I illustrated in the video, the difference between the Item code combo. with this is That part one combo has the filter text in it, when you type the items names start rearranging alphabetically. this helps to give the users the easiest way to add items to the sales details list. the following Code is for Command150 (Button Name).

Private Sub Command150_Click()

     If IsNull(ProductCombo) Then

        DoCmd.GoToControl "ProductCombo"

        ProductCombo.Dropdown

        Exit Sub

    End If

AddProductToOrder

End Sub

In Complete Inventory Management System the code above starts by checking the null value in our combo box (ProductCombo). then after that we focus on the ProductCombo then we open the dropdown menu of the ProductCombo then exit the sub if the above statement is true the app will exit the sub but if it is false the app should call AddProductToOrder.

What is AddProductToOrder?

in the Complete Inventory Management system the AddProductToOrder is a Private Function that has the codes for adding items in the Sales Details. List Let us check the code involved in this Function.

Private Sub AddProductToOrder()

If IsNull(Forms!SalesOrder!SalesOrder) Then

    Forms!SalesOrder!OrderDate = Date

    Forms!SalesOrder.Refresh

End If

 If ItemCode.Enabled = False Then

    FormattedMsgBox "Your not allowed to add" & vbCrLf & _

    "Item in a Complete order, Please Create NEW Order.!", vbInformation, "Bad Choice"

    Exit Sub

Else

 DoCmd.GoToRecord , , acNewRec

 DoCmd.GoToControl "Quantity"

 ItemCode = Me.ProductCombo.Value

 End If

End Sub

This is the code contained in AddProductToOrder, First of all, the line above checks if the sales order number is null and if found null order date will be filled with a today date the the form will refresh. After that, the app checks if there are any disabled fields if it is false then the message will pop up and exit the sub. if it is false then the app creates a new order sets the focus to the quantity, and equalizes the ItemCode value to the ProductCombo Value.

Complete inventory management system Video tutorial

ProductCombo (a combo box) (2)

This combo box has on got focus and on key up Code builds, the following are codes on respective categories.

Private Sub ProductCombo_GotFocus()
ProductCombo = ""
End Sub

Private Sub ProductCombo_KeyUp(KeyCode As Integer, Shift As Integer)
    Dim strSql As String
    
    ' Construct SQL statement based on user input
    strSql = "SELECT * FROM Inventory WHERE Description LIKE '" & Me.ProductCombo.text & "*'"
    
    ' Set the combo box's row source to the filtered data
    Me.ProductCombo.RowSource = strSql
    Me.ProductCombo.Dropdown
End Sub

Product Lookup

In this Complete inventory management system tutorial the Texbox (ProductLookup) Has the code on After Update and On Got focus. Remember this is number (2) and the function of this textbox is to sell using bar code. the thing is to have a scanner and scan the bar code of each item when registering the item's name. so when you want to sell you can identify or place the product in the sales list by scanning the bar code and place enter. the following is a code for After Update.

Private Sub ProductLookup_AfterUpdate()

Dim ProductID As Long, OrderDetailID As Long, Quantity As Double

    ProductID = Nz(DLookup("ItemCode", "Inventory", "[Bar Code]=""" & ProductLookup & """"), 0)

    If ProductID = 0 Then

        ' product not found

        MsgBox "Barcode not found in product database"

        Exit Sub

    End If

    

    ' check to see if a product is on the order

    OrderDetailID = Nz(0, ItemCode)

    If OrderDetailID = 0 Then

        ' product not on order yet, add it

        ProductCombo = ProductID

        AddProductToOrder

    Else

     If ItemCode.Enabled = False Then

        FormattedMsgBox "Invalid Action" & _

        "@This Action Not allowed@", , "Bad Choice"

        Else

        ' product is already on order, increment quantity

        Quantity = Nz(DLookup("Quantity", "SalesQ", "ItemCode=" & ItemCode), 1)

        DoCmd.SetWarnings False

        DoCmd.RunSQL "UPDATE SalesQ SET Quantity=" & Quantity + 1 & " WHERE ItemCode=" & ItemCode

        DoCmd.SetWarnings True

        Me.Requery

        End If

    End If

    ProductLookup = ""

    Me.Quantity.SetFocus

End Sub

Private Sub ProductLookup_GotFocus()

    ProductLookup = ""

End Sub

Bar code lookup (3)

In this Bar code lookup, the Texbox is Named Productlookup and has a button Captioned as Look Up.  A textbox, it has the code Get Focus and on Lost Focus, While a Button has the code On Click Event. Let's start with the On Click Event (Button)

Private Sub Command115_Click()

    Dim ItemCode As Long

    ItemCode = Nz(DLookup("ItemCode", "Inventory", "[Bar Code]=""" & ProductLookup & """"), 0)

    If ItemCode = 0 Then

        ' product not found

        If FormattedMsgBox("Barcode not found in product database. Would you like to Google it?", vbYesNoCancel) = vbYes Then

            ' Google it

            Application.FollowHyperlink "https://google.com/search?q=" & ProductLookup '& "%20site:amazon.com"

        End If

        Exit Sub

    End If

    ' product found

    DoCmd.OpenForm "Inventory", , , "[Bar Code]=""" & ProductLookup & """"

    ProductLookup = ""

End Sub

On Got Focus And Lost Focus (Text Box ProductLookup).

Private Sub ProductLookup_GotFocus()

    ProductLookup = ""

End Sub

Private Sub ProductLookup_LostFocus()

'ProductLookup = "Paste/Scan Bar Code"

End Sub

Combobox Sales Order Number Filter (4)

In this ComboBox we have three events On After Update, On Change, and On Got Focus. The event After the Update is a Micro As Seen Below in a Picture.
Complete Inventory Management System
After Update Micro

complete inventory management system (On Change)

Private Sub Combo101_Change()
If Me.Status.Value = "Not Saved" Then
        Forms!SalesOrder!FSubPurchaseOderLine.Form!Quantity.Enabled = True
        Forms!SalesOrder!FSubPurchaseOderLine.Form!txtDiscount.Enabled = True
        Forms!SalesOrder!FSubPurchaseOderLine.Form!CmdRemove.Enabled = True
        Forms!SalesOrder!FSubPurchaseOderLine.Form!CmdRemove.ForeColor = vbGreen
        Forms!SalesOrder!FSubPurchaseOderLine.Form!ItemCode.Enabled = True
        Me.SalesOrder.Enabled = True
End If
End Sub

On Got Focus

Private Sub Combo101_GotFocus()
        Forms!SalesOrder!FSubPurchaseOderLine.Form!Quantity.Enabled = False
        Forms!SalesOrder!FSubPurchaseOderLine.Form!txtDiscount.Enabled = False
        Forms!SalesOrder!FSubPurchaseOderLine.Form!CmdRemove.Enabled = False
        Forms!SalesOrder!FSubPurchaseOderLine.Form!CmdRemove.ForeColor = vbGreen
        Forms!SalesOrder!FSubPurchaseOderLine.Form!ItemCode.Enabled = False
        Me.SalesOrder.Enabled = True
End Sub

We have remained with reports in this Sales Order Form Check for the next Tutorial We will Explain the Report and More Detail. Like subscribe also Comment if you find any inconvenience, Let us know how we can help each other.

COMMENTS

Follow Me on CF
Name

Brochure Design,2,Business Card Template,2,DRUGS,1,Package Design Template,2,
ltr
item
AFYA CLUB: Complete inventory management system | 24
Complete inventory management system | 24
Welcome again to our tutorial, the last tutorial we saw the way to save and restrict some data in our Complete inventory management system
https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhYmK_Vy6dzMKRWA20kpWX2ogwOHR1XiGhyzPXTbzhRjub_f4YIvaEPCsw8ksLfRsOLk0l09zh_UrDcYrFCY3gcVq0hQQt6BBm6WD2nHnQ9w78qi2iLnEhbsSrRzJ7ZVJ5JsIGlxfNGeOQR0TMBOs0ZsUuy-NVnWYV1PUzyoH5uGKS3XlGugqQST2QJSog/w400-h225/sales.png
https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhYmK_Vy6dzMKRWA20kpWX2ogwOHR1XiGhyzPXTbzhRjub_f4YIvaEPCsw8ksLfRsOLk0l09zh_UrDcYrFCY3gcVq0hQQt6BBm6WD2nHnQ9w78qi2iLnEhbsSrRzJ7ZVJ5JsIGlxfNGeOQR0TMBOs0ZsUuy-NVnWYV1PUzyoH5uGKS3XlGugqQST2QJSog/s72-w400-c-h225/sales.png
AFYA CLUB
https://afyaclubpharm.blogspot.com/2024/01/complete-inventory-management-system-24.html
https://afyaclubpharm.blogspot.com/
https://afyaclubpharm.blogspot.com/
https://afyaclubpharm.blogspot.com/2024/01/complete-inventory-management-system-24.html
true
8307779992099520138
UTF-8
Loaded All Posts Not found any posts VIEW ALL Readmore Reply Cancel reply Delete By Home PAGES POSTS View All RECOMMENDED FOR YOU LABEL ARCHIVE SEARCH ALL POSTS Not found any post match with your request Back Home Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sun Mon Tue Wed Thu Fri Sat January February March April May June July August September October November December Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec just now 1 minute ago $$1$$ minutes ago 1 hour ago $$1$$ hours ago Yesterday $$1$$ days ago $$1$$ weeks ago more than 5 weeks ago Followers Follow THIS PREMIUM CONTENT IS LOCKED STEP 1: Share to a social network STEP 2: Click the link on your social network Copy All Code Select All Code All codes were copied to your clipboard Can not copy the codes / texts, please press [CTRL]+[C] (or CMD+C with Mac) to copy Table of Content