Try...
If DCount("Barcode", "books", "Barcode =" & Me.[barcodetext]) > 0 Then
The equals should be inside the quotes, and you may need the Me. to indicates that you're referring to the control on the form, not the field, if they share the same name
Note: this assumes that the value is a number. If it were a text string you'd need:
If DCount("Barcode", "books", "Barcode ='" & Me.[barcodetext] & "'") > 0 Then