Any chance with a bit of help on this please?
I've created a report that has a linked report attached to a button that allows the user to enter a new record. All this works fine but I would like to create a popup message that informs the user that they have attempted to add a record that already exists ie a Duplicate entry for key 'PRIMARY' - error 1062 I think.
I've tried this and it works but not very elegant.
if not exists (select tblContractXidJobNo from hilmark.tblsitesplotsjake where tblContractXidJobNo = concat((select Plot_Prefix from hilmark.tblsitesjake where Site_ID=inSiteID),'_',inPlotNum))
insert into hilmark.tblsitesplotsjake ( tblContractXidJobNo, Site_ID, Plot_Phase) values ( concat((select Plot_Prefix from hilmark.tblsitesjake where Site_ID=inSiteID),'_',inPlotNum),inSiteID, inPhaseID);
select 'dbr.text', "This Plot already exists!", 'comment';