Can't run Access2Base syntax

I have followed every thing I can find but can’t run a simple command.

Sub openform

OpenForm (“GroupLkUpF”)
end sub

EDIT: code input option (101010) didn’t work.

Code from Access2Basic site REM Open a form ... OpenForm("myForm")

I renamed form to match as shown in form selection window, no longer MainForm. When I added the OpenDB (MyOpenDB in my db) code in the tools/events as directed on Access2Basic site. It tells me I can’t connect. Luckily I have backups ! I even tried to add a push button to a form in the TT Northwiwnd tutorial DB and it wouldn’t run there either. Variable not set. I would like to do more than basic forms in LO. Without the simple “OpenForm” I can’t even make a simple switchboard !! What am I doing wrong ? Must be something in my configuration…

Been putting off learning Access2Base. Did a lot of access work many years ago. Threw together this sample when I saw your post. Open Form1 and try the buttons.

SampleAccess.odb

Possibly part of the problem is the mixing of Access and Base meanings. I only realized this when I tried your syntax. In Access a Form is a document not a section in a form - yet another reason I dis-like the terms form and subform in a Base form.

Thanks, I see you have 9 Const statements in the macro. Does that mean I would need to have those in every “OpenForm” macro and need to do the same for other “Access” commands like DoCmd., etc.?

I found those Const statements on the A2B site. I guess I could include any needed Const statements within the OpenDB module and that would make them available throughout the db. Am I correct ?

I’m thinking I might have answered my own question. If so, its going to require a massive OpenDB module to write in Access type code. Maybe I should learn the native language ! If so, what is it and how to I find it ? While trying this I tried a “oForm” syntax and it didn’t work either. Am I just spinning in circles here ?

@padricLibre a Const is nothing more than an easy way to use a specific value and make things easier to remember. When first starting in LO macros I thought Access2Base may be the way to go since I had Access background. That was about 2 years ago and I’m just starting to play with it. Learning the native Basic and a little UNO was the way I chose. I found 99% of my questions were already answered in forums and manuals. Each person is different - choose a direction & stick with it.

I’m kind of in the same boat. Think I’ll be giving the native LO method a try, Thanks for the help.

I think your last comment is the best route for using macros in Base - learn the Base language supplied with LO.

The documentation on LO is not comprehensive. This site here has some good information on Basic used in LO.

Download the document OpenOffice.org Macros Explained.pdf.

I have added to the example provided by @Ratslinger. Form3 opens Form2 just using LO Basic not requiring Access2Base.

SampleAccessMod.odb

Thanks, I’ll be giving that a try as well. Looks like it would be a better way to go. Got a lot of reading to do. Looks like using A2B requires a lot of additional code. Makes me wonder why they say A2B is included with LO. Wouldn’t be so bad except Base error trapping seems to cause fatal errors way to often. Not a good learning environment! Backup, backup, backup seems to be the word of the day for using Base.

@answered, Worked like a charm. Thanks. Off to see the wizard, so to speak. Gotta see whats behind the curtain !