G
Guest
The error duplicate error message appears if a record with the monthEnd and
FundName already exist in the SQL table. How do I clear the record so the
user can start entering data again?
strsql = "SELECT Count(*) AS CountOfMonthEnd FROM dbo_tbl_MonthlyData " & _
" WHERE (((dbo_tbl_MonthlyData.FundName)= " & Chr(34) & cboFundName& Chr(34)
& ") AND ((dbo_tbl_MonthlyData.MonthEnd)=#" & cboMonthEnd & "#));"
Set db = CurrentDb
Set rst = db.OpenRecordset(strsql)
If rst.Fields(0).Value > 0 Then
strMsg = msgbox("This Fund and Date already Exist", vbOKOnly +
vbInformation, "Duplicates")
Me.Undo
FundName already exist in the SQL table. How do I clear the record so the
user can start entering data again?
strsql = "SELECT Count(*) AS CountOfMonthEnd FROM dbo_tbl_MonthlyData " & _
" WHERE (((dbo_tbl_MonthlyData.FundName)= " & Chr(34) & cboFundName& Chr(34)
& ") AND ((dbo_tbl_MonthlyData.MonthEnd)=#" & cboMonthEnd & "#));"
Set db = CurrentDb
Set rst = db.OpenRecordset(strsql)
If rst.Fields(0).Value > 0 Then
strMsg = msgbox("This Fund and Date already Exist", vbOKOnly +
vbInformation, "Duplicates")
Me.Undo