site Search:


 
    All Forums Hot Topics Gallery






how-to block ads


 
Search Topic:
Uniqs:
589
Share Topic
Posting?
Post a:
Post a:
Links: ·How To Get Noticed ·Web Monks FAQ ·Webhosting FAQ ·Posting Code ·How To Post ·Webhosting forum
AuthorAll Replies

ybrinkmann

join:2013-01-29

Error in macro

Hello,
I have a database of business management. I have a customer table that has a field saldo_actual.
On the other hand, I have a sales form, in which I have a total field, and a button Calculate Total.
I want to make a macro that when clicking on the Calculate Total button to add the total saldo_actual field.
I assigned the macro to the button event: Mouse button released. Then I write my macro:
Sub ActualizarSaldoVentas (Evento)
Dim oFrm As Object
Dim oCliente As Object
Dim oTotal As Object
Dim oCon As Object
Dim oStat As Object
Dim sSQL As String
Dim oRes As Object
Dim sCliente as String
oFrm=Evento.Source.Model.Parent
oCliente=oFrm.getByName("cod_cliente")
sCliente=oCliente.getCurrentValue()
oTotal=oFrm.getByName("total")
oCon=ThisDatabaseDocument.CurrentController.ActiveConnection
oStat=oCon.CreateStatement
sSQL="UPDATE cliente SET cliente.saldo_actual = cliente.saldo_saldo_actual + "& oTotal.getCurrentValue()& " WHERE id_cliente=" & oCliente.getCurrentValue()
oRes=oStat.ExecuteQuery(sSQL)
End Sub
Clicking on the button Calculate total, I get the following error:
BASIC runtime error. There was an exception.
Type: com.sun.star.container.NoSuchElementException Message:
I would appreciate very much a help please.
regards,
Yessica

Monday, 20-May 17:33:29 Terms of Use & Privacy | feedback | contact | Hosting by nac.net - DSL,Hosting & Co-lo
over 13.5 years online © 1999-2013 dslreports.com.
Most commented news this week
Hot Topics