Here's the situation:
I have a form where people can order a number of products. They can set this form to varying statuses so that their supervisors can review the orders before they get placed. When the user (call them technicians) sets the order form to "review" status, the code goes through each individual item that they have ordered and checks to see if it has a serial number (thus making it a serialized item) because technicians need to enter additional information for all serialized equipment.
When it comes to a serialized item, the code opens up another form and goes to that specific items record so that the technician can edit the item-specific information.
Problem: I want the order form to cycle through these ordered items, but I need it to wait until they have closed that form that opens up for additional information before it continues on to the next item because sometimes there are multiple serialized items on one order.
Currently, it successfully goes through all of the items and identifies whether or not they are serialized items, but it goes through them all and opens up the same form for each serialized item before the user gets to put in data so it ends up with them only being able to enter data for the last serialized item.
Here is my current code:
Expand|Select|Wrap|Line Numbers
- Private Sub StatusID_AfterUpdate()
- If StatusID = 5 Then
- lbSerials.Requery
- For x = 0 To lbSerials.ListCount - 1
- If lbSerials.Column(2, x) <> "" Then
- MsgBox "You have selected a Serialized item that requires Production Information.", vbInformation, "Production Information Required"
- DoCmd.OpenForm "Production", , , "[SerialNumber]= " & "'" & lbSerials.Column(2, x) & "'"
- '<Need something here to make it wait?>
- End If
- Next x
- End If
- End Sub
Any help is much appreciated!
~Luke