[Solved] acces2base LO vs OO - Gridcontrol - Column Position

Discuss the database features
Post Reply
Michel1495
Posts: 4
Joined: Fri Apr 15, 2016 6:08 pm
Location: Villers-La-Ville Belgium

[Solved] acces2base LO vs OO - Gridcontrol - Column Position

Post by Michel1495 »

L.O. 5.1.3.2 acces2base. mysql
I created a form, grid, based on a stored query which contains all members of our club.
A button will open a form with member details based on the record ID of the member in the grid.
This ID is the first column in the grid, and therefor has position 0.
It works fine in L.O. but when I use Open Office (on another laptop) I have to change the script. The value of ID has to be set to 5??
I discovered that in L.O. this ID column has to stay the first one if I want to use "0"
In O.O. changing the position of the column doesn't change anything.
I checked if this has to do with the position in the query on which the form is build but I can't find anything.

How can I make this work in both L.O. & O.O.? As I will have more of this in my application & I want to distribute it to different people in the club, I do not want to edit all the time the macro's depending what it is used, L.O. or O.O.

This is the macro:

Function OpenFormLid
Dim ocGrid As Object
Dim ID as Integer ' ID van lid
Dim ssql as string
Dim sf as string
Dim ofForm As Object


Set ofForm = Forms("f_leden")

Set ocGrid = ofForm.Controls("MainForm_Grid")


ID = ocGrid.Controls(0).Value

sf="f_lid"

ssql = " t_leden.leden_id = " & ID

DoCmd.OpenForm (sf, ,ssql , , )


End Function
************************************************
Any help or idea is welcome.
Thank you
Last edited by Hagar Delest on Wed Jun 08, 2016 10:07 pm, edited 1 time in total.
Reason: tagged [Solved].
Open Office 4.2 on Windows 10
Arineckaig
Volunteer
Posts: 828
Joined: Fri Nov 30, 2007 10:58 am
Location: Scotland

Re: acces2base L.O vs O.O - Gridcontrol - Column Position

Post by Arineckaig »

Welcome to the forum and it is unfortunate that you have not already had a reply to your post. I suspect the reason may be that few users here have much famialarity with "access2base", which is incorporated in LibreOffice but only as an extension in OpenOffice. Furthermore the properties and methods applicable to a column in a grid form control are a somewhat obscure and less well developed section of the OpenOffice API. If the source of the incompatibility is related to your "access2base" coding, then it is an application for which I some respect but recognise it to be well above my pay grade. A direct approach to the author, Jean-Pierre Ledure known as JPL in this forum, or a search on the internet for “access2base” related sites should have a better chance of being productive.

On the other hand your description of the task gives some indication that exploitation of the Base main/subform syndrome might well meet your requirements without any resort to macro programming. Please come back if you wish to examine that option further.
When this issue has been resolved, it would help other users of the forum if you add the word - [Solved] - to the Subject line of your 1st post (edit button top right).
AOOo 4.1.5 & LO 6 on MS Windows 10 MySQL and HSQLDB
JPL
Volunteer
Posts: 132
Joined: Fri Mar 30, 2012 3:14 pm

Re: acces2base L.O vs O.O - Gridcontrol - Column Position

Post by JPL »

I'm not aware of differences in the API's of LO or AOO in this matter.
Nevertheless I can investigate the issue.

This will however take a certain amount of time. Additionally a correction - if justified - can appear only in a next release of Access2Base.
That's why I suggest you in the short-term to use the

Code: Select all

Application.Version()
property to know if the user is running either LO or AOO, and to adapt your own code appropriately.

Any info that you have about the incident is welcome either on this forum or via a private message.

JPL
Last edited by JPL on Thu Jun 02, 2016 12:37 pm, edited 1 time in total.
Kubuntu 22.04 / LibO 24.2
Access2Base (LibO).
BaseDocumenter extension (LibO)
ScriptForge (LibO)
Documentation on https://help.libreoffice.org/latest/en- ... bPAR=BASIC
Michel1495
Posts: 4
Joined: Fri Apr 15, 2016 6:08 pm
Location: Villers-La-Ville Belgium

Re: acces2base L.O vs O.O - Gridcontrol - Column Position

Post by Michel1495 »

Hello JPL
I have no problem applying your proposal to use this command. For me it is enough as solution.
I will use this script everytime I encounter differences in behaviour from L.O. & O.O.

I suppose I close this item?

To Arineckig
Thanks for replying. I do not expect a fast reply from nobody, I am retired since 1 year so I have enough other things to do. (never been so busy)
I am creating this membership application based on my ms-acces dbase. While I got ms-office for free trough the company, now I do not want to pay for it.
The form/subform is not a good solution for my needs. I use the grid just a a continues form in ms-acces & it works fine. Espec. now that JPL gave me a good idea to overcome the issue.

Thanks again, from rainy Belgium
Open Office 4.2 on Windows 10
JPL
Volunteer
Posts: 132
Joined: Fri Mar 30, 2012 3:14 pm

Re: acces2base L.O vs O.O - Gridcontrol - Column Position

Post by JPL »

I will use this script everytime I encounter differences in behaviour from L.O. & O.O.
This should not happen often !

Indeed, from my viewpoint, you may close the topic.

Thanks for using Access2Base and for your feedback.
JPL (from rainy Belgium as well ...)
Kubuntu 22.04 / LibO 24.2
Access2Base (LibO).
BaseDocumenter extension (LibO)
ScriptForge (LibO)
Documentation on https://help.libreoffice.org/latest/en- ... bPAR=BASIC
Michel1495
Posts: 4
Joined: Fri Apr 15, 2016 6:08 pm
Location: Villers-La-Ville Belgium

Re: acces2base L.O vs O.O - Gridcontrol - Column Position

Post by Michel1495 »

BTW, I am pretty sure this is not a acces2base issue, but probably the difference in structure of a grid L.O & O.O
To be honest, I prefer the O.O one as it is much more easy to manipulate colums, i.e. move the position
I think I will move to O.O.

Michel
PS Now checking how to close this item :-)
Open Office 4.2 on Windows 10
Arineckaig
Volunteer
Posts: 828
Joined: Fri Nov 30, 2007 10:58 am
Location: Scotland

Re: acces2base L.O vs O.O - Gridcontrol - Column Position

Post by Arineckaig »

probably the difference in structure of a grid L.O & O.O
FWIW, my tests indicated the API for selecting a gridcolumn by index is the same for LibreO as for AOO. I found no difference when using either for this demo file.
When this issue has been resolved, it would help other users of the forum if you add the word - [Solved] - to the Subject line of your 1st post (edit button top right).
AOOo 4.1.5 & LO 6 on MS Windows 10 MySQL and HSQLDB
Michel1495
Posts: 4
Joined: Fri Apr 15, 2016 6:08 pm
Location: Villers-La-Ville Belgium

[Solved] acces2base L.O vs O.O - Gridcontrol - Column Positi

Post by Michel1495 »

Hi, now this is VERY strange.
I can not send you an example as the back-end is a mysql db & it contains private data of our members
I created the script containg a If Then....and it works. LO => 0, OO => 5

BUT
Then I created a new (same) form using portable apps Open Office containing the same data in the grid. Now I had to assign column position = 1. & it works also using portable apps L. Office with position 1 ??
Then I created a new (same) form using Libre Office (desktop) containing the same data in the grid I had to assign column position = 0 for Libre & 1 for portable apps Open Office.

So everything works fine either Libre or Open both portable apps ??

I also find out that Libre Office is slower, & doesn't exit properly sometimes. Never had this with Open Office.
I uninstalled libre office from pc, i will only use the portable versions.

Again, this is not a access2base issue.

I will close this as there is a solution if needed
Regards
Open Office 4.2 on Windows 10
Post Reply