Thanks! cornerstone for the VB coding .. .. But .. ..
Simple problem .. .. two forms - unbound fields adding data to three tables. If the detail, about to be added is already in the primary table, then I don't want to add the record .. ..
Code from the form to add the details .. .
Private Sub Adddata_Click()
Dim dbs As Database
Dim rst As Recordset
Set dbs = CurrentDb()
Set rst = dbs.OpenRecordset("Imported_Data"
'From table
'Find the unique account number!?
rst.FindFirst (("unique_key"
= Me.[Facility] & Me.[account] & Me.[debttype])
'Finding a match, then depending on results do the following:
If rst.NoMatch Then
DoCmd.OpenQuery "NewImp_Add"
DoCmd.OpenQuery "NewAct_Add"
DoCmd.OpenQuery "NewPat_Add"
MsgBox "Added!", vbInformation, "New Account Added"
End If
End Sub
When clicking on the button, it produces a run time 3251 error on the rst.FindFirst coding .. .. Any solutions?
Simple problem .. .. two forms - unbound fields adding data to three tables. If the detail, about to be added is already in the primary table, then I don't want to add the record .. ..
Code from the form to add the details .. .
Private Sub Adddata_Click()
Dim dbs As Database
Dim rst As Recordset
Set dbs = CurrentDb()
Set rst = dbs.OpenRecordset("Imported_Data"
'Find the unique account number!?
rst.FindFirst (("unique_key"
'Finding a match, then depending on results do the following:
If rst.NoMatch Then
DoCmd.OpenQuery "NewImp_Add"
DoCmd.OpenQuery "NewAct_Add"
DoCmd.OpenQuery "NewPat_Add"
MsgBox "Added!", vbInformation, "New Account Added"
End If
End Sub
When clicking on the button, it produces a run time 3251 error on the rst.FindFirst coding .. .. Any solutions?