I have written a macro that grabs some text from two controls, one being
from a main form, and the other from a sub form.  It works fine when I'm
looking through the data, but when I get to the last record, an error
occurs and I cannot seem to figure it out.

Error:

BASIC runtime error.
An exception occurred
Type:  com.sun.star.sbdc.SQLException
Message:  The cursor points to before the first or after the last
row....

Code:

Sub ImageUpdate

dim oImageCtl as object
dim oFormDetails as object
dim oFormCtl as object
dim sImagePath as String
dim sGenrePath as String

oFormDetails =
ThisComponent.Drawpage.Forms.getByName("MainForm").getByName("BookDetails")
oFormCtl = ThisComponent.Drawpage.Forms.getByName("MainForm")
oImageCtl = oFormCtl.getByName("ImageControl")
sGenrePath =
oFormDetails.getColumns.getByName("Categores_filename").getString
sImagePath = "http://www.k-wbookworm.com/catalog/images/"; + sGenrePath +
"/" + oFormCtl.getColumns.getByName("model").getString + ".jpg"
oImageCtl.ImageURL = ConvertToURL(sImagePath) 

End Sub

I am pretty new to this macro programming and I think it is just trying
to tell me that I'm trying to look at data beyond the last record.  Is
this correct?  How do I check for that if that is the case?

Thanks,

Keith



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to