I have changed you code to the following
Private Sub cmdCI_Click()
On Error GoTo Err_cmdCI_Click
Dim i As Variant
Dim j As Variant
For i = 0 To CurrentDb.TableDefs.Count - 1
For j = 0 To CurrentDb.TableDefs(i).Fields.Count - 1
If CurrentDb.TableDefs(i).Name = "tblInvoices" And _
CurrentDb.TableDefs(i).Fields(j).Name = "Invoice" Then
MsgBox "Please Wait, Changes Are Being Made.", vbInformation, "Defining Invoice."
CurrentDb.TableDefs(i).Fields(j).DefaultValue = True
MsgBox "Congratulation!Changes Made Successfully", vbOKOnly, "Congratulation"
End If
Next j
Next i
Exit_cmdCI_Click:
Exit Sub
Err_cmdCI_Click:
MsgBox err.Description
Resume Exit_cmdCI_Click
End Sub
i want the user to see a wait message andthen a confimation or congratulation messages for successfully changing the default value. is the above code correct?