chrisjames25
Registered User.
- Local time
- Today, 00:40
- Joined
- Dec 1, 2014
- Messages
- 401
Hi. Previously had some help on here regarding checking a value didnt exist prior to updating the filed so i could populate my own message rather than the required field message.
Above is code we got to.
Question is this. Within the Tbl_Genus table there is a column called category. What i need to test for is that the genus i am typing doesnt already exist within the chosen category rather than within the whole table.
IS this possible by tweaking the dcount or would i need to create a qry and run a dcount on that as opposed to the table and use the category input as a criteria within the qry?
Code:
If DCount("genus", "Tbl_genus", "genus='" & Txt_NewGenus & "'") > 0 Then
MsgBox "The genus already exsits!!!", vbOKOnly
Cancel = True
Me.Txt_NewGenus.Undo
Me.Txt_ConfirmGenus.Enabled = False
Exit Sub
Above is code we got to.
Question is this. Within the Tbl_Genus table there is a column called category. What i need to test for is that the genus i am typing doesnt already exist within the chosen category rather than within the whole table.
IS this possible by tweaking the dcount or would i need to create a qry and run a dcount on that as opposed to the table and use the category input as a criteria within the qry?