M
midiman69
I have a problem with
If DCount("*", "tblnewparts", "partno = '" & partno & "'") = 0 Then
If MsgBox("This is a New Part - Do You Wish To Add?", vbYesNo, "Project
Costing Database") = vbNo Then
Cancel = True
Me.Undo
Exit Sub
Else: DoCmd.RunSQL "INSERT INTO tblnewparts ( partno, xfile, issue ) " _
& "Values ('" & partno & "', '" & Forms!frmprojectstabbed.Form!xfile
& "', '" & Forms!frmprojectstabbed.Form!issue & "')"
Cancel = True
Me.Undo
End If
End If
This works fine for part numbers such as 20025 but When using part number
that contain characters such as / and - eg 35006/H or 041-03729A the code
recognises these as "new parts" while in fact they are existing parts with
matching records - The partno field is text - Can any one help?
Also when using paste append to import data from excel all part numbers
trigger the new part dialogue - why is this?
Cheers Dave
If DCount("*", "tblnewparts", "partno = '" & partno & "'") = 0 Then
If MsgBox("This is a New Part - Do You Wish To Add?", vbYesNo, "Project
Costing Database") = vbNo Then
Cancel = True
Me.Undo
Exit Sub
Else: DoCmd.RunSQL "INSERT INTO tblnewparts ( partno, xfile, issue ) " _
& "Values ('" & partno & "', '" & Forms!frmprojectstabbed.Form!xfile
& "', '" & Forms!frmprojectstabbed.Form!issue & "')"
Cancel = True
Me.Undo
End If
End If
This works fine for part numbers such as 20025 but When using part number
that contain characters such as / and - eg 35006/H or 041-03729A the code
recognises these as "new parts" while in fact they are existing parts with
matching records - The partno field is text - Can any one help?
Also when using paste append to import data from excel all part numbers
trigger the new part dialogue - why is this?
Cheers Dave