Re: not duplicating "Invoice No." field
1 In your table you could set the Index property to Yes(No
Duplicates). Open your table in design view, select the "Invoice No." field
and set the property in the bottom part of the design grid. Access would
throw up an error message any time you tried to save a duplicate invoice#.
OR
2 In your form where you enter Invoice No., put the following code in
the Before Update event of the "Invoice No." field:
If DCount("[Invoice No]","NameOfYourTable","Forms!NameOfYourForm![Invoice
No]") > 0 Then
MsgBox "Duplicate Invoice No Not Allowed"
Cancel = True
End If
The message will appear if you try and enter a duplicate Invoice No and you
will not be allowed to continue until you change the Invoice No.
I provide help with Access applications for a modest fee. I could set up
your database so that the math on invoices would automatically be checked as
you enter them in Access. Excel would be eliminated and your doing double
duty would be eliminated. My fee would be very reasonable. Contact me at
[email protected] if you are interested.
Steve