• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

User Form entry sheet Validation check

Gary H

New Member
Hello all.
Apologies if this question may have been answered before but I've tried the usual searches including Search Engines etc. and either can't seen to find anything, or my lacking in skills stops me from interpreting the answers. Also apologies in advance for the long post...

Okay, so my current project is to make our current silo records (I work for a Coffee Company) digital so that the data can be extracted from a spreadsheet. I've created a User Form for the bean store operators to complete when they load the coffee into the silos. I have it cobbled together from various search results/posts from forums etc. (the code and layout is probably not very pretty or efficient) and it works. However, I would like to make it more secure when entering some of the data.
The first combo box is the stock code for the raw coffee and the second text box is the warrant number for that particular crop - these are both to be entered via a barcode scanner, so I would like to make it whereby they can only be scanned into their relevant fields. I figure this would require some sort of check and error message if it was incorrect, preventing the operator from continuing unless the correct barcode is scanned.
I am also struggling to make it whereby the form clears itself once submitted and cannot be submitted unless all fields are filled (avoiding blank rows on the spreadsheet).

This is my first venture into VBA so please don't be afraid of treating me like a complete newbie - I almost certainly will need to ask questions later...all help is greatly appreciated in advance.

Gary
 

Attachments

  • Silo Entry Form -WORKING - Copy (07.11.19).xlsm
    203.4 KB · Views: 16
Something like this?
The comboboxes and the textboxes are mandatory fields.
If you enter something in a combobox that are not in the combobox list you get an error message.
In the Warrant Number field you only can enter numbers.
 

Attachments

  • Silo Entry Form.xlsm
    168 KB · Views: 4
Wow, that's fantastic Belleke! It works like a dream ;)
I see there's a long way to go for me...I have much to learn. I think I may have to look at doing a course!

Just one thing I didn't make clear at the start. Although I used numerical format on my upload, there are occasions where the Warrant Number also includes text.
Looking at the code you have written I can see where you define it so that only numbers are accepted. Could this be changed so that it, say, checks against the Stock Code field instead to make sure the same barcode hasn't been scanned again (there are only 2 barcodes on the label - Stock Code and Warrant Number).
As the Warrant number is unique to each crop/delivery, unfortunately I wouldn't be able use the same method as Stock Code i.e. checking against a list...

Thanks for the assistance, it's very much appreciated!
Gary
 
Admin - is it okay to leave this thread as it is for now, in case I have any other queries?
or would you prefer that I mark it as 'Solved' and start a new thread, if I have any further questions?
 
Admin - is it okay to leave this thread as it is for now, in case I have any other queries?
or would you prefer that I mark it as 'Solved' and start a new thread, if I have any further questions?
Hi ,

Not at all ; mark it as solved only when you do not have any fresh questions on the original topic of the thread , which was Data Validation.

Narayan
 
Back
Top