Code: Select all
REM ***** BASIC *****
REM Remove all "tPerson"."Check"
Sub Main(e)
Const cReset = "UPDATE ""tPerson"" SET ""Check""=False"
oActiveConnection = e.Source.Model.Parent.ActiveConnection
oPrep = oActiveConnection.prepareStatement(cReset)
n = oPrep.executeUpdate()
PhoneFax 'Call Sub PhoneFax
End Sub
REM Remove all "tPhoneFax"."Check"
Sub PhoneFax
Const cReset = "UPDATE ""tPhoneFax"" SET ""Check""=False"
oActiveConnection = e.Source.Model.Parent.ActiveConnection
oPrep = oActiveConnection.prepareStatement(cReset)
n = oPrep.executeUpdate()
EmailAddress 'Call Sub EmailAddres
End Sub
REM Remove all "tEmailAddress"."Check"
Sub EmailAddress
Const cReset = "UPDATE ""tEmailAddress"" SET ""Check""=False"
oActiveConnection = e.Source.Model.Parent.ActiveConnection
oPrep = oActiveConnection.prepareStatement(cReset)
n = oPrep.executeUpdate()
NextRecord 'Call Sub NextRecord
End Sub
REM NextRecord
Sub NextRecord
Dim document As Object
Dim dispatcher As Object
document = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
dispatcher.executeDispatch(document, ".uno:NewRecord", "", 0, Array())
End sub
The decision was made to add checkboxes to records in multiple tables (tPerson, tPhoneFax, and tEmailAddress), to trigger the User to verify data during data entry, because entries must be UNIQUE.
The specific tables were chosen because Persons do not change their GivenNames easily (other than start using or never providing ' nicknames', like 'Nick' or 'Nicolas'), or Surnames, other than when they get married or something similar. The same applies to Phone Numbers and/or eMail Addresses. Therefore the information in these specific tables helps the User to identify the Person who must be/has been entered.
TRIGGERS for the specific tables have been added to the DataBase, so the User will be notified when applicable.
The User is to investigate, and has to make an informed decision. This could based on a repeat of an eMail Address, and/or Phone Number, and/or GivenName & Surname.
To avoid the specific TRIGGER to fire, the statement like
has been added."tPhoneFax"."Check"=FALSE
The moment the User has made an informed decision, the User can Check the specific existing record, and will therefore be able to enter a copy of the present data.
To avoid the User having to reset all the Checks in the mentioned tables by hand, Villeroy was kind enough to guide me into the right direction.
Now I am dealing with multiple tables where Checks can be placed, and all need to be reset at once, so history can repeat itself.
I do not see what is wrong, but the attached screenshots show that the code does not finish.
Can anyone guide me in the right direction?
Dream