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?
 
Ok still need help, I really appreciate you helping me with this and I'm sure I will catch on to this but I have changed the code to this as the ME part referring to the form and I also put the spaces back into the source names. I may have it really wrong now but with your help I am understanding it a little better.

Code:
Private Sub scrap_entry_Click()

Dim varEmployee_Number

a = MsgBox("Do you want to enter extra scrap codes?", vbYesNo)
If a = vbYes Then
    
    varEmployee_Number = Me!Shop_Floor_Data_Entry.Value
    varItem_Number = Me!Shop_Floor_Data_Entry.Value
    varShop_Order_Number = Me!Shop_Floor_Data_Entry.Value
    varOp_Number = Me!Shop_Floor_Data_Entry.Value
   
    
    RunCommand acCmdRecordsGoToNew
    
    Me!Shop_Floor_Data_Entry = varEmployee_Number
    Me!Shop_Floor_Data_Entry = varItem_Number
    Me!Shop_Floor_Data_Entry.Value = varShop_Order_Number
    hop_Floor_Data_Entry = varOp_Number
    MsgBox ("Thank You")
    
End If
End Sub
 
Upvote 0

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
When trying it I get and error or the code stops here

Code:
varEmployee_Number = Me!Shop_Floor_Data_Entry.Value
 
Upvote 0
It's really not and error the code just stops there

How can you tell it just stops there? The code will either execute completely, or fail at which point there will be an error. It won't just stop.

Or....When it stops, is the line highlighted in yellow? Or is there a brown dot next to that line?
 
Upvote 0
Also this code is attached to the Item number text box
Code:
Private Sub Item_Number_AfterUpdate()
    Static abort As Boolean
    If abort Then abort = False: Exit Sub
    Shop_Order_Number = Mid(Item_Number, 6, 5)
    Op_Number = Mid(Item_Number, 11)
    abort = True
    Item_Number = Mid(Item_Number, 1, 5)
End Sub
 
Upvote 0
That code works fine for what I need it to do, not sure if it would effect the other code your helping me with
 
Upvote 0
Could it be that I have your code placed in the wrong area? I have it attached to a button
 
Upvote 0
Not in the wrong area. Should be attached to a button. When the debugger comes up, what happens if you step (F8) to the next line? It shouldn't not do nothing. It should at least populate with an error message.

And when you are looking at the code, there is no brown dot next to the line where it stops is there?

Maybe try saving everything and shutting Access down and reopen the db.
 
Upvote 0

Forum statistics

Threads
1,224,617
Messages
6,179,914
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