Fai la tua domanda

jvglynnjr's profile - attività

2019-08-15 03:48:27 +0200 received badge  Domanda gettonata (source)
2019-08-09 11:12:23 +0200 ha commentato una domanda Shell() function crashes

New one is 6.2.5.2. Not sure what the old one was, since it was on a hard drive that failed. I do have another, older

2019-08-09 02:17:38 +0200 ha posto una domanda Shell() function crashes

Shell() function crashes This may be an OS problem, but I'm starting here because I'm very puzzled. I have an establishe

2019-08-08 17:54:00 +0200 ha commentato una risposta How to fix missing java problem in base

This did not work for me. When I tried sudo find . -name 'javac' I got ./snap/core/7272/usr/share/bash-completion/

2019-08-08 17:52:48 +0200 ha commentato una risposta How to fix missing java problem in base

This did not work for me. When I tried **sudo find . -name 'javac'** I got ./snap/core/7272/usr/share/bash-completion/

2019-04-29 00:11:04 +0200 ha accettato una risposta form macro not handling date correctly

I'm trying to pass a formatted field containing a date from a form to a table through an update query, but I can't get it to work. The code below works when I switch the receiving column to a text-formatted one, but I need to be able to put this update into a date-formatted column.

This is the macro I'm using (relevant parts, anyway)


REM  *****  BASIC  *****

const TableName = "tbStockRoom"
const IDField = "SKU"
const ValueField = "On_Shelf"

REM  This needs to be changed to "expDate"
const DateField = "bogus_text"
REM


global oConn as Object
global CtrlId as object, CtrlValue as object

global CtrlDate as object


Sub UpdateADDQuery(oEvent)

dim oQuery as Object 
dim oStatement as Object
dim Result as long

dim SQL as String

dim oForm as Object
dim oField as Object
dim CtlView as Object
dim item as String

    SQL = "update """ & TableName & """ set """ & ValueField & """ = """ & ValueField & """ + " & CtrlValue.currentValue & _
         " , """ & DateField & """ = " & CtrlDate.currentValue & " where """ & IDField & """ = " & CtrlId.currentValue

        oQuery = oConn.createStatement()
        Result = oQuery.executeUpdate(SQL)

End Sub

Sub InitForm(oEvent)

oConn = ThisDatabaseDocument.DataSource.getConnection("","") 
CtrlId = oEvent.source.parent.getByName("Form2").getByName("fmtID")
CtrlValue = oEvent.source.parent.getByName("Form2").getByName("fmtInteger")

CtrlDate = oEvent.source.parent.getByName("Form2").getByName("fmtDate")

It runs fine as is, but when I switch DateField to a date-formated column, I get this error message:

BASIC runtime error. An exception occurred Type: com.sun.star.sdbc.SQLException Message: Wrong data type: java.lang.IllegalArgumentException.

I tried inserting a CAST() function into the SQL to force the parameter to be interpreted as date, but I must be doing it wrong because it always gives nonsense syntax. Could this have something to do with handling quotes? I don't really understand why some of the above are single and not tripled, but like I said, this runs just fine.

Any help appreciated.

2019-04-29 00:11:04 +0200 received badge  Studioso (source)
2019-04-28 20:31:04 +0200 ha modificato una domanda form macro not handling date correctly

form macro not handling date correctly I'm trying to pass a formatted field containing a date from a form to a table thr

2019-04-28 20:28:52 +0200 ha commentato una risposta form macro not handling date correctly

Thanks, Ratslinger, that did the trick. I just changed CtrlDate.currentValue to Format(CtrlDate.currentValue, "'YYYY-MM-

2019-04-28 20:27:58 +0200 ha risposto a una domanda form macro not handling date correctly

Thanks, Ratslinger, that did the trick. I just changed CtrlDate.currentValue to Format(CtrlDate.currentValue, "'YYYY-MM-

2019-04-28 19:14:47 +0200 received badge  Domanda gettonata (source)
2019-04-28 08:07:38 +0200 ha posto una domanda form macro not handling date correctly

form macro not handling date correctly I'm trying to pass a formatted field containing a date from a form to a table thr

2018-10-12 06:08:14 +0200 received badge  Domande famose (source)
2018-04-06 03:09:42 +0200 received badge  Domande famose (source)
2017-04-05 12:59:24 +0200 received badge  Domanda notevole (source)
2017-03-20 08:43:49 +0200 received badge  Domanda notevole (source)
2017-03-20 08:43:49 +0200 received badge  Domande famose (source)
2017-03-18 23:06:49 +0200 received badge  Domande famose (source)
2017-02-17 19:38:00 +0200 received badge  Domande famose (source)
2016-11-03 10:47:58 +0200 received badge  Domanda notevole (source)
2016-11-03 10:47:58 +0200 received badge  Domanda gettonata (source)
2016-11-02 22:35:14 +0200 received badge  Domande famose (source)
2016-11-01 04:40:39 +0200 received badge  Domanda notevole (source)
2016-10-28 19:44:01 +0200 received badge  Domande famose (source)
2016-10-07 23:46:45 +0200 received badge  Studente (source)
2016-10-03 15:20:00 +0200 received badge  Domanda notevole (source)
2016-09-18 13:04:08 +0200 received badge  Domanda gettonata (source)
2016-08-24 16:47:35 +0200 received badge  Domande famose (source)
2016-08-23 14:21:44 +0200 ha commentato una risposta handle runtime error sql macro

Not clear at all what this is doing. Why would I need that loop? Also, not looking for a null value in the table, just a select criterion that doesn't find a record.

2016-08-22 22:26:24 +0200 received badge  Domanda gettonata (source)
2016-08-22 21:16:26 +0200 ha posto una domanda handle runtime error sql macro

problem: In a macro that executes an SQL query, when the user-inputted key value is not found, there is a run-time error. How can I have the macro exit the subroutine when this occurs rather than trigger a run-time error? (which opens a debugging screen, confusing the user?) i.e. I want there to be a messagebox to warn the user to retry input whenever a value that is not already in the table is entered.

2016-08-21 04:13:48 +0200 received badge  Domanda notevole (source)
2016-08-20 06:22:58 +0200 received badge  Domanda gettonata (source)
2016-08-01 09:40:39 +0200 received badge  Domanda gettonata (source)
2016-07-30 16:19:10 +0200 ha posto una domanda password protect base macro

I would like one of the macros that runs from a pushbutton control in a Base form to be password protected. Is there any way I can do this with a simple pop-up dialog? I thought this might be a built-in macro, but have not been able to find it.

2016-07-29 11:46:02 +0200 received badge  Revisore (source)
2016-07-28 23:20:09 +0200 received badge  Domande famose (source)
2016-07-28 14:01:02 +0200 received badge  Domanda gettonata (source)
2016-07-28 05:59:29 +0200 ha posto una domanda base macro beep function

I'm trying to use the built-in function Beep in a Base macro, but it doesn't seem to do anything.

Sound works otherwise on the system (ubuntu 16.04)

2016-07-28 05:20:32 +0200 ha posto una domanda base form multi-line text box auto scroll?

I have a text box that displays a cumulative output with a new line at the end of each item. It has a vertical scroll bar. How do I get the box to autoscroll down to the bottom as the visible part fills up, the way a terminal window would?

2016-07-27 08:32:09 +0200 ha posto una domanda base SQL to return single value for macro

If I put a SELECT SQL statement in a Base macro, how can I get it to return a single value to a variable?

In other words, I want to query a value for the unique primary key of a table and get the value from another column of that row.

2016-07-22 03:04:12 +0200 ha commentato una risposta base macro to restore focus to a form field

thanks, that works!

2016-07-20 21:06:25 +0200 ha commentato una risposta base macro to restore focus to a form field

I tried adding this code to the end of my macro, got "BASIC run time error. Variable not defined."

oForm = ThisComponent.Drawpage.Forms.getByName("Form1")

2016-07-20 15:53:02 +0200 received badge  Domanda notevole (source)
2016-07-20 15:52:09 +0200 ha posto una domanda base macro to restore focus to a form field

I have a Base form that runs a macro when the value is entered, but then the focus shifts to the next tab stop. How can I make the focus return to the control again?

2016-07-16 02:46:53 +0200 ha commentato una risposta scanner entry form

Page 27 of the Getting Started is about tab stop order. I tried making the field I want the 1st tab stop, but that doesn't give it the focus when the form loads!

Am I missing something there?