I made a fill in form, when the user clicks the save button the data of the fields will be saved into a new record with .AddNew and .Update. That's working OK. But when I use DoCmd.close at the end of the sub (or I close the form by hand) an empty record is been added to the database with index "0". How can that be ???
The Code :
Private Sub Knop82_Click()
Set Db = CurrentDb()
Set rs = Db.OpenRecordset("select * From Investmentplanning;")
NoInputStr = ""
If Me.NewInvestmentNaam = "" Then
NoInputStr = "Investment Name"
GoTo Else1
Else
With rs
.AddNew
!IndexNumber = IndexNR
!InvestDate = Datum
.Update
MsgBox ("Application Form is saved")
DoCmd.Close
End With
End If
Does anybody have a clou
The Code :
Private Sub Knop82_Click()
Set Db = CurrentDb()
Set rs = Db.OpenRecordset("select * From Investmentplanning;")
NoInputStr = ""
If Me.NewInvestmentNaam = "" Then
NoInputStr = "Investment Name"
GoTo Else1
Else
With rs
.AddNew
!IndexNumber = IndexNR
!InvestDate = Datum
.Update
MsgBox ("Application Form is saved")
DoCmd.Close
End With
End If
Does anybody have a clou