Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

BASIC runtime error


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: 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
    next i
        rem oform.updatestring(3,sFile)
        if oform.isnew then
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"