If I understood correct, wouldn't that be a simple if:
private void BillBCOValue_Leave(object sender, EventArgs e)
{
if(string.IsNullOrWhiteSpace(BillBCOValue.Text))
{
MessageBox.Show("Textbox empty!");
}
else
{
var testresult = GlobalConfig.AccountTable.GetByAccount(BillBCOValue.Text);
if (testresult == null)
{
MessageBox.Show("BCO must be a valid Account Code");
BillBCOValue.Focus();
}
}
}
Refer:
String.IsNullOrWhiteSpace(String) Method (System) | Microsoft Docs[
^]