Still Trying to change a boolean value

I have read and tried every snippet of code, usually I get an error message from anything I have tried here…for example I tried this code :slight_smile:
Sub UpdateBoolen()
Dim bYes as boolean,oDrawpage as Object
bYes=TRUE
oDrawPage.getByName(“GRPChged”).effectiveValue = bYes
oDrawPage.getByName(“GRPChged”).commit(bYes)
End Sub

“GRPChged” is a boolean value in my GRPTable
This is called from a text box Changed Event…I get a runtime error here oDrawPage.getByName(“GRPChged”).effectiveValue = bYes Object variable not set
my limited apparent understand was that these fields were available from the event handler, like the form name and the Calling control name which I have been able to access. This software crashes all the time and it recovers itself. I can’ even get the MRI program to work effectively either. I have a mac running Mac O 14. I may have to breakdown and buy a cheap window laptop and run access there, I never had this frustration. I attribute it to my own ignorance but thenI am beginning to wonder. I am certainly not new to this stuff just very very frustrated especially when using snippets of suggested code to try and they almost always fail with n error. PERHAPS I have something setup incorrectly… I would really like to make a go of this as I am somewhat tenacious.
Respectfully,
Glen

Lets start to find some common ground. Do you know the guide for Base? Available from LibreOffice.org in menu “get help” > Documentation.
It also covers some macros…

I have it setting right next to me, I have read it , also have read the online API stuff. This was all so simple in Access, You have the calls with the expected parameters. There is something I am missing for example I could do things like Table!Field= (some value). I used basic and SQL. I have the two tables joined and I created a query for the report which works except trying to create a multigroup sort does not work either. I can sort on City but not on Day so the Days within Cities are out of Ascension, I can live with that right now but I need a way to change to boolean value in the table when a record is edited so that I can print out a report that just shows items that need to be updated somewhere else. This should be a lot simpler, it is just me maybe…Is there something incorrect in my setup. I have tried connecting to the Database which should already be connected because I can edit a form. So yes lets take it from the top.

Thanks for your patience,
Glen

Manipulating widgets on a DrawPage is pointless.

Stick to MS Access which is a multi-million Dollar database development suite.
Base is a tiny addition to an office suite.

@GlLHarvey : Could you add an example and describe the boolean value, which should be changed by which event?

A typical form event macro looks like this:

def someFormEvent(ev):
    frm_1 = ev.Source #calling form
    frm_1_1 = ev.Source.getByName("Subform1") # a subform
    frm_0_0 = ev.Source.Parent #may be the forms container or a parent form
    frm_0_2 = frm_0_0.getByName("Form2") # another form on the same level as the caller
    # a form is a mainly a record set rather than a bunch of widgets
    frm_1.next()
    int_col = frm_1.findColumn('My Bool') # 1-based column index
    frm_1.setBoolean(int_col, True) 

Whenever I need something like that, I ask myself how to improve the database and the form design.
Starting with a control’s event:

def someControlEvent(ev):
    ctrl = ev.Source
    model = ctrl.getModel()
    frm = model.getParent()

Well I. solved the problem, though tenacity and reading and trying many print statements I can get the value of a field in a form and change it. The real world documentation and example are poor at best…
I have a window laptop coming this morning n=and will purchase a standalone access. I cannot afford to waste so many hours navigating this software. I will continue to investigate though but will need to use something else to keep my sanity. I appreciate all th help from Robert especially the correct nomenclature for fields and controls vs widgets. I salute you for your staying power and vigilance.

Respectfully,
Glen