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
Whoops!
Just realised I can't use the check box as it selectes all the lines to be invoiced. Not just the one its on - but anywaty I will have some sort of field that can be used to diffentiate which lines to invoice. So the above still applies.
Lou