Hi everyone,
I have what feels like a basic question, but for some reason I can’t find the answer.
I’m working on a simple database to keep track of my clients, services, quotes and invoices.
I have a form to create new quotes, and within that I have a subform with a table (grid?).
One of the columns in that table is converted to a listbox so I can select a service I can add to my quote.
I am trying to create a Basic macro to fill the rest of the fields with the relevant information based on which service has been selected. (they get copied over from the Services table)
The problem is that I don’t know the correct way I need to access the data in the table on the form. A certain something (coughchatgptcough) gave me these lines:
oForm = ThisComponent.Drawpage.Forms.getByName("Quotes").getByName("QuoteLines")
sServiceID = oForm.getByName("clmDescription").CurrentValue
Quotes = main form
QuoteLines = subform
clmDescription = the collumn I’m trying to get the data from. With that I can get the relevant info from my Services table
I get an error that the component doesn’t exist, so I’m guessing this is not the correct way to point to the table on my subform, but ChatGPT insists that it is.
Anyone who knows the correct way?