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.
I have a listbox (lstbxBrtCtry) that is populated with country names using a sql select distinct statement that queries the worldcites table. The selected country is then put into the {birthCountry) textbox to the left of the list box.
I am trying to populate the (BirthCitylst} listbox based on which city is in the {birthCountry) textbox using a macro.
Here is the macro which I have attached to the (BirthCitylist) listbox when gaining focus event.
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
REM Determine if the countrylist text box has a value
oForm = ThisComponent.DrawPage.Forms.GetByName("dsPhotoInfo")
oCountryBox = oForm.getByName("birthCountry")
IF NOT IsNull(oCountryBox.text) THEN
MSGBOX( "BIRTHCOUNTRY TRUE",MB_OKCANCEL,"DEBUG")
ELSE
MSGBOX( "BIRTHCOUNTRY NOT TRUE",MB_OKCANCEL,"DEBUG")
ENDIF
End Sub
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 save the macro and the form then run the form and select the (BirthCitylist) listbox nothing happens neither message box get called.
can somone please tell me what I am doing worngly
Thanks.