troubleshooting Question

Process order lines selected in a subform

Avatar of Louverril
Louverril asked on
Visual Basic ClassicMicrosoft Access
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

ASKER CERTIFIED SOLUTION
Log in to continue reading
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform for $9.99/mo
View membership options
Unlock 1 Answer and 21 Comments.
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
The Value of Experts Exchange in My Daily IT Life

Experts Exchange (EE) has become my company's go-to resource to get answers. I've used EE to make decisions, solve problems and even save customers. OutagesIO has been a challenging project and... Keep reading >>

Mike

Owner of Outages.IO
Phoenix, Arizona, United States
Member Since 2016
Join a full scale community that combines the best parts of other tools into one platform.
Unlock 1 Answer and 21 Comments.
View membership options
“All of life is about relationships, and EE has made a virtual community a real community. It lifts everyone's boat.”
William Peck

Member since 2004