+ Reply to Thread
Results 1 to 6 of 6

Userform signing out equipment - Table searching help

  1. #1
    Registered User
    Join Date
    02-21-2013
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    29

    Userform signing out equipment - Table searching help

    I have a userform that allows users to sign out items and return them whenever; all data is put onto a table

    When they return it, they just put their name in, the item the want to return, and the code searches the table for their name and the item and inputs the date they returned it a few columns over.

    The problem is, I can't get it to work. Like I said, i'm using a search function to count through the rows and match up the inputted name and item.

    The most frustrating thing is everything worked a while ago but I recently added more columns to the table and I thought I changed everything correctly, but it seems I haven't, and I can't seem to find where I messed up.

    Example: NameA takes out itemA and then returns it. A messagebox should appear saying the item was returned, but it doesn't appear. It also doesn't sppear to be returned on the table itself.

    That's the main problem. I'm also having a problem with the error messagebox. If NameA tries to return ItemB without ever signing it out, a message box should appear, but it doesn't. Not too concerned because it shouldn't be a problem as long as staff don't purposely do this.

    Lastly, how can I make sure the "date to be returned" is always consistent in it's format? I have the cells formatted as Long Date but inputting different date formats seem to make it stay as is.

    Thanks, any help is appreciated.
    Attached Files Attached Files
    Last edited by Battletoads; 08-07-2014 at 03:08 PM.

  2. #2
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: Userform signing out equipment - Table searching help

    you assigned Label "Equipment" to Textbox "txtPrice"
    If solved remember to mark Thread as solved

  3. #3
    Registered User
    Join Date
    02-21-2013
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    29

    Re: Userform signing out equipment - Table searching help

    Quote Originally Posted by patel45 View Post
    you assigned Label "Equipment" to Textbox "txtPrice"
    On the userform you mean? That's just to put a rough value to the item being lent out

  4. #4
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: Userform signing out equipment - Table searching help

    Hi, Battletoad,

    do you still need help on the issue as this thread is marked Solved?

    I have a couple of additional questions/remarks prior to starting to work on the code (a couple of these might call for a re-design of the UFs) and would do so only if you come back and there still is some need for help.


    You have given names to the ranges but you should exchange Names with Employees as Names is a VBA Keyword. And you have used fixed ranges so any change in Names, Items, Programs will cause you to change these ranges whereas adding a dynmaic range like http://spreadsheetpage.com/index.php...nter_new_data/ might help.

    You want to enter the information about the loaner into the UserForm while I would prefer to create a list of addresses and choose from there (holding a unique number for each client which may be referred to). You might use a List- or ComboBox to choose from with a hidden first column holding the ID and the second showing the full name and getting the information for the other fields via VLookUp). You may even add an entry into the database via another UF.

    The items to loan are plainly listed in your approach but I would go with the same concept here as for the clients using maybe the serial number as an ID together with the full name as you may have a couple fo items from the same brand.

    You may even create an additional list of prices for the items based on duration of loan and maybe a category for each individual loaner.

    For returning date I would prefer to use some kind of DatePicker (there are samples on the net for creating a UF to fulfill this task). You should maybe have a combobox instead of a fixed date to be entered giving you a bit more flexibility on the returning date and leaving it up to the code to format the date.


    Since you want to enter the data into a Table you canīt use the commands like for entering data into a nonformatted list. Using the End(xlUp) command will bring you to the last cell in a given column in the Table but it will also do this if the last rows in the Table are not filled with data. To get the last filled row of data inside a Table you would need to start at the header of that column and use End(xlDown) and work from there. Same goes for entering new data. You would need to add a new line to the Table if needed and not write the data to the first line after the Table.
    Please Login or Register  to view this content.
    might help to add a new row to the Table if needed.


    Regarding the return of items I would imagine a different approach. You would need the name of the employee as well as of the client there and a list of items the client has loaned within a List- or ComboBox to choose from (make multiple selections available as well as it would be the same date of return for the items. When filling the box with data I would use another hidden column for entering the row number of the item in order to write data to if returned. Maybe I got the concept wrong but I would make it loaner based and not employee based as I imagine every employee to enter returned items no matter if she or he was the person to hand it out. Please correct me if Iīm wrong on this.


    A lot of text (and hopefully not too many typos in here - you might keep them if you find them, Iīve got more than enough still to spend ).

    Ciao,
    Holger
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

  5. #5
    Registered User
    Join Date
    02-21-2013
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    29

    Re: Userform signing out equipment - Table searching help

    Thank you for the suggestions Holger/

    I'm making this for someone so it would depend on what they want as well as my own abilities as a coder but I will definitely try some of your suggestions out.

  6. #6
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: Userform signing out equipment - Table searching help

    Hi, Battletoads,

    feel free to come back and ask if you would need help on an idea or with a code. And you should sit down by yourself and make a plan on how you want the application to look like and talk with the people about it as well: if they donīt feel comfortable with the look or the working flow thereīs hardly a chance they will enjoy using it (which means a lot of error handling needs to be included).

    Ciao,
    Holger

+ 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. Name Selection in a userform, To create a Signing In Sheet.
    By Sean Gillan in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 07-21-2014, 10:38 AM
  2. Name Selection in a userform, To create a Signing In Sheet.
    By Sean Gillan in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-15-2014, 05:23 PM
  3. Changing Equipment form to Userform
    By roelof bakker in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-06-2014, 04:21 AM
  4. searching data using a userform
    By stephen1000 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-05-2009, 10:58 AM
  5. Calculate total time worked from signing in and signing out
    By sumankhs in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-08-2007, 08:58 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