About VBA I'm just a starter !
I wanna know if it's possible to jump out of a loop when I click on knob on the screen. See the code below, the While do loop and the knob "Knop82_Click".
According to VBA I only may use a function or a variable in the While loop.
Please let me know what to do !
Loop-Code:
Set rs = Db.OpenRecordset("select * From Investment;")
With rs
Do
Me.NewInvestmentNummer = InvestNR
Me.NewInvestmentDatum = Datum
Me.NewApplicantNaam = username
InvestName = Me.NewInvestmentNaam
BudgetY = Me.NewBudgetJaar
InvestPurpose = Me.NewInvestmentDoel
Necess = Me.NewNecessity
InvestDescrip = Me.NewInvestmentDescription
TestDescrip = Me.NewTestDescription
Howtest = Me.NewHowTestingNow
InvestReal = Me.NewInvestmentRealisation
While Knop82_Click() = "-1"
Knob-Code:
Private Sub Knop82_Click()
Set rs = Db.OpenRecordset("select * From Investmentplanning;")
With rs
.AddNew
!IndexNumber = IndexNR
!InvestDate = Datum
!InvestNumber = InvestNR
!ApplicantName = username
!InvestmentName = InvestName
!BudgetYear = BudgetY
!InvestmentPurpose = InvestPupose
!Necessity = Necess
!InvestmentDescription = InvestDescrip
!TestDescription = TestDescrip
!HowTestingNow = Howtest
!InvestmentRealisation = InvestReal
MsgBox ("Weet u zeker dat de ingevulde gegevens kloppen !")
.Update
MsgBox ("Uw Application Form is opgenomen in de database")
'DoCmd.OpenForm "Newapplicationform", acNormal
rs.Close
End Sub
I wanna know if it's possible to jump out of a loop when I click on knob on the screen. See the code below, the While do loop and the knob "Knop82_Click".
According to VBA I only may use a function or a variable in the While loop.
Please let me know what to do !
Loop-Code:
Set rs = Db.OpenRecordset("select * From Investment;")
With rs
Do
Me.NewInvestmentNummer = InvestNR
Me.NewInvestmentDatum = Datum
Me.NewApplicantNaam = username
InvestName = Me.NewInvestmentNaam
BudgetY = Me.NewBudgetJaar
InvestPurpose = Me.NewInvestmentDoel
Necess = Me.NewNecessity
InvestDescrip = Me.NewInvestmentDescription
TestDescrip = Me.NewTestDescription
Howtest = Me.NewHowTestingNow
InvestReal = Me.NewInvestmentRealisation
While Knop82_Click() = "-1"
Knob-Code:
Private Sub Knop82_Click()
Set rs = Db.OpenRecordset("select * From Investmentplanning;")
With rs
.AddNew
!IndexNumber = IndexNR
!InvestDate = Datum
!InvestNumber = InvestNR
!ApplicantName = username
!InvestmentName = InvestName
!BudgetYear = BudgetY
!InvestmentPurpose = InvestPupose
!Necessity = Necess
!InvestmentDescription = InvestDescrip
!TestDescription = TestDescrip
!HowTestingNow = Howtest
!InvestmentRealisation = InvestReal
MsgBox ("Weet u zeker dat de ingevulde gegevens kloppen !")
.Update
MsgBox ("Uw Application Form is opgenomen in de database")
'DoCmd.OpenForm "Newapplicationform", acNormal
rs.Close
End Sub