Hi All
I have a bound text box (Assembly_NumberSpec) and field (AssemblyNumberSpec) in tblAssemblies.
What I need to happen is after the user has enter data into (Assembly_NumberSpec) to check for any duplicates and in (AssemblyNumberSpec) in tblAssemblies
If duplicates are found I need to clear the textbox and re set the focus and display error msg 'This Assembly/Spec already exists'.
I have tried this but not had any success
Any advice appreciated
I have a bound text box (Assembly_NumberSpec) and field (AssemblyNumberSpec) in tblAssemblies.
What I need to happen is after the user has enter data into (Assembly_NumberSpec) to check for any duplicates and in (AssemblyNumberSpec) in tblAssemblies
If duplicates are found I need to clear the textbox and re set the focus and display error msg 'This Assembly/Spec already exists'.
I have tried this but not had any success
Code:
If DCount("AssemblyNumberSpec", "[tblAssemblies]", "Assembly_NumberSpec = me.assembly_NumberSpec") > 0 Then
MsgBox "This Assembly/Spec already exists."
Any advice appreciated