[libreoffice-users] Data filtering with Base

2016-05-13 Thread Egbert Eissing
 
Hello,
I encounter a bigproblem by filtering data in a form by a date. Several days 
ofexperimenting did not produce any working result. 
On of many filterstrings I experimented with is as follows:sFilter= chr(34) 
 & chr(34) & " = " & chr(39) &(sDescription) & chr(39) & " AND " & 
chr(34) &"Expense"& chr(34)&"."(34)&"dateEntered"& chr(34) & " = " & 
chr(39) & aDate (39) This produces anerror message: “incorrect property 
value”
Another filterstring which looks more promising goes like this:sFilter= chr(34) 
 & " = " & chr(39) & sDescription (39) & " AND " & 
"Expense"&"."&"dateEntered " & ">= " & chr(39) & fDate & chr(39) & chr(34) The 
result shown ina message box looks as follows:"Description ='SalaryMidMonth' 
AND Expense.dateEntered >= '16/04/2016'"
After applying thisfilter, no data is shown on the form, instead the following 
errormessage:The data contentcould not be updated | Syntax error in SQL 
statement. 
If I remove the date part of the filter, the filtering works fine. I believe 
theproblem is in the expression “ Expense.dateEntered “. Unfortunately I need 
tospecify the table name, because the query has two tables, both ofwhich have a 
“dateEntered” column. In all my previous datafiltering with dates, a table did 
not need to be specified, and italways worked without problem. 
Here is yet anotherfilter formulation (same as before, but chr(34)) on both 
ends removed:sFilter= sSearchfield & " = " & chr(39) & sDescription (39) & 
" AND " & "Expense"&"."&"dateEntered " & ">= " & chr(39) & fDate & chr(39) 
msgbox output:Description ='SalaryMidMonth' AND Expense.dateEntered >= 
'16/04/2016'This filter filterscorrectly by “Description”, but does not filter 
by date.
I have also beenexperimenting with different formats of the date specification, 
suchas “2016-04-16” as well as the “dim aDate as Newcom.sun.star.util.Date” 
format. 
The column in theunderlying mySQL database table is of the “Date” type. 
Can anybody help meby pointing out what is wrong with the above filter 
composition?Thanks very much inanticipationEgbert Eissing
-- 
To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted


[libreoffice-users] base - reading a field from an open form

2016-03-03 Thread Egbert Eissing
 p { margin-bottom: 0.1in; line-height: 120%; }I need to read thefield on 
another open form. To this end I experimented with thefollowing code snipped:
 oFormMMquotation =ThisDatabaseDocument.FormDocuments.getByName("MMquotation") 
oQt_ID =oFormMMquotation.getByName("MMquotation").getByName("qt_ID") sQt_ID 
=oQt_ID.text msgbox "sQt_ID " & sQt_ID
Unfortunately, thereis an error on the second line: “Property or method not 
found:getByName”Can anybody provideme with a clue on how to substitute the 
“getByName” method? I hope so.
Thanks for helping.Egbert
-- 
To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted


[libreoffice-users] base - getting error when loading a dialog

2016-02-24 Thread Egbert Eissing
 p { margin-bottom: 0.1in; line-height: 120%; }I am experimentingwith Dialogs.I 
prepared a dialogcalled TestDialog, which is stored on the dialog organizer 
windowunder: My Dialogs >Standard > TestDialog. I did not select this 
position,it was automatically saved there. 

The code to openthis dialog: If notDialogLibraries.IsLibraryLoaded("Standard") 
Then DialogLibraries.LoadLibrary( "Standard" ) endif
  dim oDlg as object dim oCtl as object dialogLibraries.loadLibrary("Standard") 
oDlg =createUnoDialog(DialogLibraries.Standard.TestDialog) ' Error here oCtl 
=oDlg.getControl("labelField") oCtl.TEXT = "Resetall update marks?"

I get the followingerror: BASIC runtime error.Property or methodnot found: 
TestDialog. 
I wonder, what am Idoing wrong, or what have I neglected to do?
Any hint to solvethis riddle would be very much appreciated indeed.Egbert

-- 
To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted


[libreoffice-users] Base - table control functionality

2016-02-22 Thread Egbert Eissing
 p { margin-bottom: 0.1in; line-height: 120%; }With the new libreOffice 5.04, 
Table control has lost it's abilityto configuer columns.On my newly produced 
forms, integers look like prices, dates show upin the wrong order, price 
columns are totally un-formated and boolencolumns look like '0.00',or '1.00'.My 
system is openSUSE linux, the libreOffice package was installedfrom the 
openSUSE repository.
Is this functionality really missing, or am I missing something? Iwonder. Any 
help in this matter would be thankfully appreciated.Egbert

-- 
To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted


[libreoffice-users] Base - Function Sequence Error

2016-02-20 Thread Egbert Eissing
 p { margin-bottom: 0.1in; line-height: 120%; }Function SequenceError. What is 
that? 

I have a form linkedto a MySQL server's telephone numbers Table.Whenever a 
newtelephone number is added three additional data fieldsalso need to 
betransferred to the new row. Here is a code ssnippet.First the datafieldsare 
being read, then the form moves to the InsertRowand then the data iswritten 
back into the respective fields. Finally an updateRowand a form.reload causes 
the above mentioned error.Does anybody have asuggestion how this error can be 
avoided? 
 oPhoneNr =oForm.getByName("phoneNr") sPhoneNr =oPhoneNr.TEXT sPhoneNr 
="000-"
 oCodeName =oCompanyForm.getByName("codeName") sCodeName =oCodeName.TEXT  
oForm.MoveToInsertRow  oPhoneCoKey =oForm.getByName("phoneCoKey") 
oPhoneCoKey.boundField.updateString(sPhoneCoKey) oPhoneCoKey.commit()
 oPhoneNr.boundField.updateString(sPhoneNr) oPhoneNr.commit()
 wait(100) oForm.updateRow() oForm.reload()

-- 
To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted


[libreoffice-users] Base - hiding a push button conditionally

2016-02-06 Thread Egbert Eissing
 p { margin-bottom: 0.1in; line-height: 120%; }I have the 
followingArrangement:The main form of the document is (oForm), and there is a 
subform (oMangForm).On the subform, thereis a push-button, which I wish to hide 
under certain conditions.I have carefullyread all the documents available to 
me, but I could not find a clueon how to do that. Hereis a code snipped:
 oDoc =ThisComponent oDrawpage =oDoc.drawpage oForm 
=oDrawpage.forms.getByName("startMenu") oComputerNameBox 
=oForm.getByName("computerName") oMangForm =oForm.getByName("mangForm") 
oMangFormLbl =oMangForm.getByName("mangFormLbl") oMangFormLbl.Label= 
("Management") oMangFormSupplBtn =oMangForm.getByName("oMangFormSupplBtn")  REM 
Error:com.sun.star.container.NoSuchElement oMangFormSupplBtn.setVisible(false)
My problems are onlythe last 2 lines. I would be veryhappy if someone could get 
me a hint on how to accomplish this.Thanks for helpingand regards, Egbert

-- 
To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted


[libreoffice-users] Base - automatically running a macro on form opening

2016-02-03 Thread Egbert Eissing
I need to fire up a macro automatically when I open a form, or when I move to 
the next record. 
There is obviously no form event that allows me to do that. I have placed a 
simple macro, containing nothing but a message box into all relevant event 
slots, to see whether any one of them will fire. But none did. This appears to 
be strange to me, lacking such an important function.I am now using a button to 
run my macro, but this is unsatisfactory. 
Does anyone have an idea how I can accomplish my task?Thanks for any help.Egbert

-- 
To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted


[libreoffice-users] Base: problem with where clause in a select query.

2016-01-25 Thread Egbert Eissing
 

I must be doingsomething wrong: Here is the where clause of my select query 
within amacro:
WHERE ""EmployeeID""='" + sEmployeeID + "' AND ""ItemValue""<> '0' AND 
""MidOrEndMonth"" = '0'")
Instead of returningthe table rows where “ItemValue” IS NOT “0”, it returns 
therows where the “ItemValue” IS “0”. On the other hand, if Iplace this query 
into the query editor, it returns all the rowscorrectly. 
I would appreciateif someone could point out to me how the syntax could be 
improved tothat the correct rows are being collected. 
Thanks for yourhelp.Egbert

-- 
To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted


[libreoffice-users] Transferrig a parameter to a sub form

2016-01-14 Thread Egbert Eissing
 I have a form with atable control which lists all the employees, and a 
sub-form with atable control that lists the payroll data of each employee. 
If an employee isselected in the first table, the employeeID should be passed 
to thesub form to filter the data for the selected employee. The code couldlook 
something like this:
 oDoc=ThisComponent.DrawPage.Forms oFormACemplData=oDoc.getByName("ACemplData”) 
' main form oFormPayrollData=oDoc.getByName("FormPayrollData”) ' sub form
 oEmployeeID =oForm.getByName("employeeID") ' employeeID is theparameter for 
TablePayrollData. sEmployeeID =oEmployeeID.text  oFormPayrollData.Parameter= 
setINT(sEmployeeID) oFormPayrollData.refresh()
It is this second tolast line, the syntax of which I do not know, and have not 
been ableto find in any of the examples I have read and re-read. Alternatively, 
if itis not possible to just pass a parameter to the table, may be it 
ispossible to pass a complete prepared statement instead. 
Could anybodyprovide some clue on how to do it?Thanks for helping. Egbert
-- 
To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted


Re: [libreoffice-users] Re: Displaying data on an unbound field

2016-01-13 Thread Egbert Eissing
Thanks very much for your replies and your help.I couldn't quite make things 
work, which prompted me to take another approach. The unbounded text boxes were 
only to show Information
and this can also be done with labels. So I used labels. The last line of my 
code example would than be: 
oDiscountFact.Label = format(sDiscountFact, sFormatString2)
After having made the conversion to label a thought occurred to me: The text 
boxes and the associated labels were both given the same name, and therefor the 
confusion. I am not sure, but it sounds plausible. I have been working with 
database front ends for about 20 years, using Rekall, and there this problem 
never arose.Thanks againEgbert


On Wednesday, 13 January 2016, 3:42, Andreas Säger  
wrote:
 

 Always the same answer:

> https://forum.openoffice.org/en/forum/viewtopic.php?f=20=81276=375294#p375294

Using the GUI, I can set the default value for an unbound text box
belonging to any form or subforme, and nothing changes this text. Then I
can inspect this text box using MRI and find out the property I need to set.


-- 
To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted


  
-- 
To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted


[libreoffice-users] Displaying data on an unbound field

2016-01-11 Thread Egbert Eissing
I have a form which holds several fields which are not bound to a database 
table, but are showing data for information purposes only.

Consider the following code snippet.

    oResultSet = oStatement.executeQuery()
    if not isnull(oResultSet)then
    oResultSet.next
    sDiscountFact = oResultSet.getString(1) 
    oDiscountFact = oForm.getByName("discountFact")
      oDiscountFact.TEXT = format(sDiscountFact, sFormatString2)
    end if

If the form has just been opened, the last line returns an error:
"Property or method not found: .TEXT."
If I now change the formatted field to a text box and back again to a formatted 
field, the problem is solved - until the form is closed and opened again.Is 
this a bug to be fixed soon, or is this a more permanent "feature"?

Now I changed the last line with the following:
    oDiscountFact.setString(sDiscountFact)
That produces the same error message:
"Property or method not found: setString."

I have also tried:
    oDiscountFact.BoundField.updateString(sDiscountFact)
As expected, this does not work, because the field is not bound to a database.

Is there any other alternative to display text on an unbound field, one that 
works correctly all the time? The solution to this problem is really important 
for me. 

Thanks for any suggestions.
Egbert

-- 
To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted


[libreoffice-users] BaseForms: transferring contents of data fields to the database table

2016-01-04 Thread Egbert Eissing
I have a main form and a sub form. 
The main form holds one single record, the sub form contains multiple records 
related to the record in the main form. 
Both forms are holding alphanumeric and also pure numeric data. 
I wrote a macro to evaluate and calculate the numeric data in the sub form and 
deposit the results in fields of the main form. 

Now my problem: The numbers placed in the main form fields by means of the 
macro are not recognized by the back end MySQL database. These simply are not 
transferred, whatever I do. (If I write some figures in manually, the same are 
being transferred without problem.) What can I do to work around this problem? 
Is there any kind of trick that makes the form believe that the automatically 
generated data have been put in by hand and treated accordingly? I am sure 
there must be a solution to this. 
Thanks for any help. 

-- 
To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted