Can a form macro read a non-form db table

I have a form that shows information about members in a club. I want to add a button to the form that when pushed executes a macro that reads a non-form based table that holds information about upcoming meetings. The macro would then update a field on the form to show the retrieved data from the non-form DB table.

The issue I appear to be having is that the macro, when executed from the form button, doesn’t have context for the non-form table. Can I explicitly bind the macro SQL statement to the external DB table.

For example… Form is bound to the Members Table and can access it’s fields. A second table exists call Meeting, that hold info on future (and past) meetings. When the use clicks the “Attend Next Meeting” button the macro determines what meeting is available to the member (based on some of the fields in the Members table) by reading the external Meetings table, and retrieving the next meeting type and date, then stores that data into the Members table.

Can this be done in a Base form macro?

Hello,

You have basically done this already - SQL in macro.

With a macro you can access any table within the current DB or with some further code access other databases even different types (PostgreSQL, MySQL. Oracle, etc) and with proper authorization access any of those tables.

See http://www.pitonyak.org/database/AndrewBase.pdf

Also for a broader view look at Open Office Macros Explained by Andrew Pitonyak. PDF here → OOME

Thx… I was getting errors and wanted to make sure it was possible. Seemed like it should have been. So, I’ll work on debugging the code as it’s obviously a connection error in my code. I can run the SQL locally and it retrieves the values. When I do it from the macro I get an empty result set…so back to the debug process…