I am writing a Database to catalog various picture that I have on my heard drive. I have made a form with various fields on it.
Here is the macro attached to the BirthCitieslst listbox.
Sub pick_city_list Dim oForm as Object Dim countryText as string Dim cityList as Object Dim cityBox as Object Dim oCountryList as Object Dim oCountryBox as Object Dim idebugCode as integer REM Determine if the countrylist text box has a value oForm = ThisComponent.DrawPage.Forms.GetByName("dsPhotoInfo") oCountryBox = oForm.getByName("birthCountry") IF oCountryBox.text <> "" THEN idebugCode = MSGBOX( "BIRTHCOUNTRY TRUE",MB_OKCANCEL,"DEBUG") IF idebugCode = 1 OR idebugCode = 2 THEN EXIT SUB ELSE EXIT SUB END IF ELSE MSGBOX( "BIRTHCOUNTRY NOT TRUE",MB_OKCANCEL,"DEBUG") IF idebugCode = 1 OR idebugCode = 2 THEN EXIT SUB ELSE EXIT SUB END IF ENDIF
Here is a url do download the database and some files and folders with pictures if you need to test ou what I mean
I am only using MSGBOXES becasue I read somewhere online that ThisComponent cannot be used with the BASICIDE debugger. I I am falling back to the oldest method of debugging and using MSGBOXES becasuse I could not locate a PRINT() function in Libreoffice BASIC.
The problem comes when I run the form. I put focus on the BirthcCities list box and the MSGBOX come up but then pressing either the ok or cancel buttons does nothing. Even clicking the X in the upper right of the MSGBOX does nothing. I eventually have to press CTRL-ALT-DELETE to get to the Task Manger and end LibreOffice from there. I do not understand why EXIT SUB is not being executed.