Form / Table help

jcaptchaos2

Well-known Member
Joined
Sep 24, 2002
Messages
1,032
Office Version
  1. 365
Platform
  1. Windows
I have a form where the user scans his ID and then a work order bar code which files in order number, item number and op number, he then enters with the keypad, good pcs, scrap pcs, selects a scrap reason code from a combo box and then selects the time the job was started. It also will add the current time, date and total time to the table automatically. My question is the person may have 5 scrap pcs for one reason and 1 scrap for another reason and so on, how can I make it so they would just have to enter the second scrap reason and pcs and not have to go through the whole for again? If I type it in now without scanning the other information it will leave blank cells in the table and will not be linked to the order, empl or item numbers. Would this be where I would use a subform?
 
You'll want to put this prior to the other If statement:
Code:
 If yourTextBox.Value = "" Or IsNull(yourTextBox.Value) Then
    MsgBox ("Please enter a valid quantity.")
    Exit Sub
End If

This is a simple way of doing it but can't check to see if the entry is a valid number. There is something else that you can do to check to see if the characters are numerical or not, but that I don't know how to do. If you need to know, then I would start a new thread with that question and someone will get to you. This just checks to see if it is empty.
 
Last edited:
Upvote 0

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
I am adding to the code on the button you helped me with so there is no other if statement

Here's what I though it should look like - scrappcs being the name of the control source
Code:
 If scrappcs.Value = "" Or IsNull(scrappcs.Value) Then
    MsgBox ("Please enter a valid quantity.")
    Exit Sub
End If
 
Upvote 0
It seems to be working I needed to use the name not the source thanks again
Code:
 If Scrap_Pcs.Value = "" Or IsNull(Scrap_Pcs.Value) Then
    MsgBox ("Please enter a valid quantity.")
    Exit Sub
End If
 
Upvote 0

Forum statistics

Threads
1,224,616
Messages
6,179,912
Members
452,949
Latest member
beartooth91

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top