+ Reply to Thread
Results 1 to 10 of 10

VBA Forms search and update

  1. #1
    Registered User
    Join Date
    12-03-2013
    Location
    Mumbai
    MS-Off Ver
    Excel 2007
    Posts
    36

    VBA Forms search and update

    Hi team,

    I work with the accounts payables team wherein we receive invoices on a daily basis from external service providers and we need to track the incoming invoices and update the status as and when it gets processed.

    In order to track them I have built an excel form which helps in updating the invoices into excel as and when we receive it.

    However as and when we complete the processing we need to update the status of these invoices. Is there anyway we can have a search utility built in the form which can use the Invoice Number(unique ID) for populating all the details in the form and provide an option for updating the status.

    I am attaching the Invoice tracker for your reference.

    If anyone can help me with the code for searching and Updating the already inserted invoice data, it will help me in floating this into production. Please let me know if you need any more information.

    Thanks a ton for your assistance in advance.

    Regards,
    Raghu
    Attached Files Attached Files

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: VBA Forms search and update

    Hello Raghukumarn,

    Welcome to the Forum!

    The attached workbook has the search feature added. There are a few other changes as well. The "OK" button does nothing. It has been replaced by the "Update" button. I created two new macros to make working with the data easier. The macros are ReadRecord and WriteRecord. ReadRecord copies the data from the worksheet to the UserForm. WriteRecord does the reverse. Each of these uses the worksheet row number of the invoice.

    Try this out and let me know the results.
    Attached Files Attached Files
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Registered User
    Join Date
    12-03-2013
    Location
    Mumbai
    MS-Off Ver
    Excel 2007
    Posts
    36

    Re: VBA Forms search and update

    Thanks a lot for your help Leith.

    Integrating my tracker with the codes which you have furnished. I will upload the tracker once it is completed.

    Thanks a ton for your help.

    Regards,
    Raghu

  4. #4
    Registered User
    Join Date
    12-03-2013
    Location
    Mumbai
    MS-Off Ver
    Excel 2007
    Posts
    36

    Re: VBA Forms search and update

    Hi Leith

    Attached is the updated one.

    However the search functionality is not working as per expectation. Can you please take a look.

    Regards,
    Raghu
    Attached Files Attached Files

  5. #5
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: VBA Forms search and update

    Hello Raghu ,

    I see you have multiple entries for the same invoice. The macro was written to find the first invoice number in the database and return that record's information. I will work on a way to let the user choose an invoice with multiple listings.

  6. #6
    Registered User
    Join Date
    12-03-2013
    Location
    Mumbai
    MS-Off Ver
    Excel 2007
    Posts
    36

    Re: VBA Forms search and update

    Hi Leith,

    I am trying to limit the invoice number to unique Id eo that users cannot enter duplicate records. you can see duplicates now as I was testing. Is there anyway we can assign primary key to each entry.

  7. #7
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: VBA Forms search and update

    Hello Raghu ,

    This version of the workbook is almost a complete rework of the first workbook. All the UserForm functions are now controlled by the command buttons on the UserForm.

    Users will be alerted when an invoice already exists. The invoice number can only be entered once. The user can simply type in the invoice number in the text box and after pressing "enter" or clicking a different control, the record will be displayed. If the user types in the invoice number and then clicks "Insert", a new record will be added to the next line below the last entry on "Data" provide the invoice number has not be used. Otherwise, the user will be notified the invoice number exists and to edit the record using the "Update" button.

    There are two controls missing on the UserForm: Invoice_Receipt_Date, Invoice_Log_Date. Once you add these control, the code for these will need to be added to the UserForm. Try this version and let me know how you like it.
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    12-03-2013
    Location
    Mumbai
    MS-Off Ver
    Excel 2007
    Posts
    36

    Re: VBA Forms search and update

    Thanks a Ton Leith.

    This definitely helps.

    Regards,
    Raghu

  9. #9
    Registered User
    Join Date
    12-03-2013
    Location
    Mumbai
    MS-Off Ver
    Excel 2007
    Posts
    36

    Re: VBA Forms search and update

    Hi Leith,

    I have attached the updated tracker with all the relevant details required(thanks to you).

    Need the final part of the puzzle fixed. Have inserted a box for UID which needs to be autopopulated for each entry inserted by the users and the same can be used in the search utility as it acts as the primary key.

    While Inserting an entry can the UID field be updated with the formula (prev row of UID column + 1) in order to assign an UID sequentially for each entry.

    Regards,
    Raghu
    Attached Files Attached Files

  10. #10
    Registered User
    Join Date
    12-03-2013
    Location
    Mumbai
    MS-Off Ver
    Excel 2007
    Posts
    36

    Re: VBA Forms search and update

    Hi Leith,

    Its resolved.

    Regards,
    Raghu

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Update listbox (forms)
    By Zurn in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-22-2013, 03:02 PM
  2. Access 2007 Forms Update and Add Cross Referenced Field
    By jvbeats in forum Access Tables & Databases
    Replies: 5
    Last Post: 02-01-2013, 03:36 PM
  3. Search for and Display multiple same date info in separate forms
    By RossN in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-21-2012, 06:39 PM
  4. User Forms for search
    By armstrong2010 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-12-2011, 02:35 PM
  5. Linking user forms together and recording on database with a search function
    By mal.b.graham in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-20-2011, 07:36 AM

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