Results 1 to 9 of 9

(updating inventory using user form) : Assign macro to "Çheck Availibility" command button

Threaded View

  1. #1
    Forum Contributor
    Join Date
    07-04-2012
    Location
    malaysia
    MS-Off Ver
    Excel 2007
    Posts
    105

    (updating inventory using user form) : Assign macro to "Çheck Availibility" command button

    Hi guys.

    I need some help here. I want a macro that can update the inventory by using the user form. I need a macro to be assigned on "check availability" command button.

    Every time the user insert the item code in textbox1, the macro will identify the value in textbox1 which match the code in database column C.Then, it will display the respective quantity in column I into textbox2 (user form).

    However, if the textbox1 (user form) = "" or value in textbox1(userform) doesnt not exist in database, the macro need to display "Not available" message.


    Here are the the code that i try to modify, but it doesnt fully work on certain condition

    Private Sub CommandButton1_Click()
    x = 9
    
    Dim qty As Integer
    qty = 0
    Do While Cells(x, 3) <> ""
    If TextBox1.Text = Cells(x, 3) Then
    TextBox2.Value = Cells(x, 9)
    qty = qty + TextBox2.Value
    End If
    x = x + 1
    Loop
    TextBox2.Value = qty
    MsgBox "WRONG"
    End Sub
    I hope you can help me on this. Thanks in advance. Really appreciate your help.
    Attached Files Attached Files
    Last edited by pyol17; 12-07-2012 at 08:13 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1