Page 1 of 1

[Solved] Property 'Only Data Entry' in form

Posted: Sun Apr 29, 2018 1:13 pm
by JoseJuan
Hi,

I want to use the same form to edit and add new records, from diferent buttons.
I need to change the 'Only Data Entry' property of the form depending on the button that calls it.

There is a drop down for this form property in design mode, data tab, I just need to assign the value of this property when loading the form.

I have managed to position the form when opening in a new record using moveToInsertRow, but I do not want to keep access to other records from the navigation bar. Disable some buttons of this bar would serve to me.

Greetings.

Re: Property 'Only Data Entry' in form

Posted: Sun Apr 29, 2018 4:05 pm
by Villeroy
Use a better database frontend. Base is too simple (and therefore difficult to use) for developers who want full control over the GUI elements.

Re: Property 'Only Data Entry' in form

Posted: Sun Apr 29, 2018 5:30 pm
by JoseJuan
Thanks for the advice. The licensing policy of my company does not allow me to use another development tool.
I have been using ms-acc for many years and I did not think that something so simple, such as choosing the data mode when opening a form or changing that property when opening it, would be so complicated in BASE.

Re: Property 'Only Data Entry' in form

Posted: Sun Apr 29, 2018 6:43 pm
by UnklDonald418
Maybe something here would help
Macro to open form with add data only behaviour

Re: Property 'Only Data Entry' in form

Posted: Sun Apr 29, 2018 6:53 pm
by Villeroy
The whole Base component, including all the drivers weighs 30MB. The forms are attached to office documents. There is absolutely nothing which comes even close to MS Access.

Re: Property 'Only Data Entry' in form

Posted: Sun Apr 29, 2018 11:21 pm
by UnklDonald418
This seems to work on my form

Code: Select all

REM  *****  BASIC  *****

Sub ToggleAddDataOnly(oEv as object)
Dim oForm as object

oForm = oEv.Source.Model.Parent
If oForm.IgnoreResult = TRUE then
  oForm.setPropertyValue("IgnoreResult", FALSE)
else
  oForm.setPropertyValue("IgnoreResult", TRUE)
end if
oForm.reload
oForm.moveToInsertRow

End Sub

Re: Property 'Only Data Entry' in form

Posted: Mon Apr 30, 2018 6:27 pm
by JoseJuan
Thanks very much. :bravo:
Now the mine also run fine, it's just what I was looking for.

Regards.