Hi.
I am not an expert Libre Office Base, but I am trying to do some basic macro, and for some reason I am getting an error every time I click on the only form I have saying that I have a BASIC runtime error. Despite that, the MACRO seems to be doing its job anyhow.
I would appreciate if somebody could give me some advise here
This is the exact error message
-
BASIC runtime error.
An exception occurred
Type: com.sun.star.container.NoSuchElementException
Message: There is no element named ‘Citacion’…
A this is the code
sub S_SelectFile
oform = thiscomponent.drawpage.forms.MainForm.SubFormCitaciones
ofpkSelectFile = oform.getbyname("FileSelection")
sUrl = converttourl(ofpkSelectFile.Text)
for i = len(sUrl) to 1 step -1
if mid(sUrl,i,1) = "/" then
sFile = mid(sUrl, i+1, len(sUrl))
exit for
endif
next i
rem oform.updatestring(3,sFile)
oform.updatestring(5,sUrl)
if oform.isnew then
oform.insertrow
else
oform.updaterow
endif
end sub
Sub S_insert_url_to_Button
oform = thiscomponent.drawpage.forms.MainForm.getbyname("SubFormCitaciones")
oButton = oform.PushButtonCitacion
oButton.TargetUrl = oform.Columns.getbyname("Citacion").getstring
end sub
By the way. There is a fiels named “Citacion” on the table called “Citaciones”
Regards