I have experienced this before and had to debug the way Cardyin explains.
I found it was the form load statement to be the culprit. Try this for
giggles. It worked for me. Unload the calling form first. Then load the
other form. I know this sounds stupid but it fixed it for me. I don't know
why but it did. I can show u what I had to do. This is not the best
solution because the user sees the desktop for a split second but I
couldn't figure anything else out.
HTH
If ErrorCode <> -1 And Trim(UCase(CountryMade)) = "PHILIPPINES" _
Or UCase(CountryMade) = "MADE IN PHILIPPINES" And Not gblnInOpticalVillage Then
frmScanItemNr.Show vbModal 'get the part number
Unload frmScanItemNr
Set frmScanItemNr = Nothing 'clean up from form unload
frmProdNrLotNrScan.Show
Unload FrmCustProd
Set FrmCustProd = Nothing
End if