When I close an fill in form, that I saved before (.update all the fields into database) with a save button on the form, I get an access messagebox that there are 2 users who are using this form ! And I (= user 2) can save it again but the information (saved by the save button (= user 1) will be lost or I can cancel it. But everytime I close this form I get this unwanted message.
It's possible to solve this problem/message when I set the property settings of this form to NO for: allow edit, allow change and allow delete and bolt all the fields on the form. So I get an fill in form where it's not possible to fill in or change something !!! So that's not what I want offcourse !!!
Does someone know how to handle this ?
The code of the form:
Private Sub Form_Load()
Me.LastChangedBy = username
Me.LastChangeDate = Datum
Offerte = ""
Slide = ""
Foto = ""
StrFilePath = ""
stPath = ""
Index = IndexNumber
Set Db = CurrentDb()
Set Rs = Db.OpenRecordset("Select InvestmentPurpose FROM InvestmentPlanning WHERE IndexNumber=" & Index)
Me.SelectInvestmentPurpose = Rs!InvestmentPurpose
Rs.Close
Set Rs = Nothing
End Sub
Private Sub Save_Click()
Set Db = CurrentDb()
Set Rs = Db.OpenRecordset("select Offer, EstimatedPrice, PowerPointSlide, Photo, Capital, Expense, EEA, ROI, PaccarProjectNumber, Agreed, CarryOver, SbonNumber, SbonDate, FinishedSbonDate, ProductReceived, ChangeDate, ChangedBy From Investmentplanning where IndexNumber=" & Index)
With Rs
.Edit
!EstimatedPrice = Me.NewEstimatedPrice
!SbonNumber = Me.NewSbonNR
!SbonDate = Me.NewSbonDate
!FinishedSbonDate = Me.NewFinSbonDate
!ChangeDate = Date
!ChangedBy = username
.Update Rs.Close
Set Rs = Nothing
MsgBox("Form saved")
'DoCmd.Close
DoCmd.OpenForm "StartFormBeheerder", acNormal
End With
End Sub
It's possible to solve this problem/message when I set the property settings of this form to NO for: allow edit, allow change and allow delete and bolt all the fields on the form. So I get an fill in form where it's not possible to fill in or change something !!! So that's not what I want offcourse !!!
Does someone know how to handle this ?
The code of the form:
Private Sub Form_Load()
Me.LastChangedBy = username
Me.LastChangeDate = Datum
Offerte = ""
Slide = ""
Foto = ""
StrFilePath = ""
stPath = ""
Index = IndexNumber
Set Db = CurrentDb()
Set Rs = Db.OpenRecordset("Select InvestmentPurpose FROM InvestmentPlanning WHERE IndexNumber=" & Index)
Me.SelectInvestmentPurpose = Rs!InvestmentPurpose
Rs.Close
Set Rs = Nothing
End Sub
Private Sub Save_Click()
Set Db = CurrentDb()
Set Rs = Db.OpenRecordset("select Offer, EstimatedPrice, PowerPointSlide, Photo, Capital, Expense, EEA, ROI, PaccarProjectNumber, Agreed, CarryOver, SbonNumber, SbonDate, FinishedSbonDate, ProductReceived, ChangeDate, ChangedBy From Investmentplanning where IndexNumber=" & Index)
With Rs
.Edit
!EstimatedPrice = Me.NewEstimatedPrice
!SbonNumber = Me.NewSbonNR
!SbonDate = Me.NewSbonDate
!FinishedSbonDate = Me.NewFinSbonDate
!ChangeDate = Date
!ChangedBy = username
.Update Rs.Close
Set Rs = Nothing
MsgBox("Form saved")
'DoCmd.Close
DoCmd.OpenForm "StartFormBeheerder", acNormal
End With
End Sub