troubleshooting Question

Process order lines selected in a subform

Avatar of Louverril
Louverril asked on
Microsoft AccessVisual Basic Classic
21 Comments1 Solution193 ViewsLast Modified:
I have an "order "form with "Item_Order_Line" as a subform.

I have an invoice button on the order form to start a create invoice process. On the Item_Order_Line subform I have tick boxes against each line.

I want the invoice button to select the lines  which have been ticked (unbound tickbox) - so I can fill them with an invoice number. I have written the following code to first check if any have been ticked, but it just gets stuck in a loop. Is this because I cannot loop through screen rows or is the "do while " wrong?

If I should be using a recordset how do I recognise the selected lines - they have just been ticked (and the tick not saved anywhere).

'Check if any lines were selected for invoicing
   
    Dim linesq As Boolean
    linesq = False
     
    Do While Item_Order_Line.Form.NewRecord = False
       If Item_Order_Line.Form!InvMe = True Then
        linesq = True
       Exit Do
       End If
    Loop
 
    If linesq = False Then
   MsgBox "Please select item(s) to invoice.", 0 + 64
  End If

Please help - ASAP please!
Thanks
Lou

Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 21 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 21 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros