You can put the criteria in a new column in the query grid like this, using the correct form name and check box name:-
------------------------------------------------ Field: IIf([Forms]![formName]![checkBoxName]=True, [ID] Is Not Null, True)
Now when the check box on the form is checked and the query is run, the [ID] Is Not Null in the IIF expression will return all the records where the ID field is not empty. When the check box on the form is not checked, the final True in the IIF expression will return every ID including the empty IDs.