Can't change or add records in subform?

Creating and using forms
Post Reply
User avatar
peterdines
Posts: 42
Joined: Thu Nov 06, 2008 9:06 am

Can't change or add records in subform?

Post by peterdines »

I created a form with subform in the wizard, for a MySQL database via ODBC. There was already a relationship between the tables. When I used the form I couldn't add or change any records in the subform.

I figured maybe it was because of something in MySql so I tried creating a Base document in the native database format and had the same result. What am I doing wrong? This is in OO 3.
OOo 3.3 / Mysql / Postgres / OS X 10.6.5
timbo43
Posts: 4
Joined: Thu Oct 30, 2008 8:33 pm

Re: Can't change or add records in subform?

Post by timbo43 »

When you say you "can't add or change records", what exactly do you mean? Was there an error message?

Best wishes,

Tim.
OOo 3.0.X on MS Windows Vista + Ubuntu
User avatar
peterdines
Posts: 42
Joined: Thu Nov 06, 2008 9:06 am

Re: Can't change or add records in subform?

Post by peterdines »

Nothing in the subform table is editable. The new record button is grayed out. I can see data if it's there, but I can't add or change e.g. invoice line items. In the form wizard I chose "arrangement of the subform" as "data sheet".
OOo 3.3 / Mysql / Postgres / OS X 10.6.5
timbo43
Posts: 4
Joined: Thu Oct 30, 2008 8:33 pm

Re: Can't change or add records in subform?

Post by timbo43 »

In the list of forms, try right-clicking on the form and selecting Edit.
Then right-click on the subform and select Form. Click on the data tab.

There are three entries: Allow additions, Allow modifications, Allow deletions. Are these all Yes?

If that doesn't help, you could check that each column in the grid has Read-only set to No.

I hope that helps.

Best wishes,

Tim.
OOo 3.0.X on MS Windows Vista + Ubuntu
User avatar
peterdines
Posts: 42
Joined: Thu Nov 06, 2008 9:06 am

Re: Can't change or add records in subform?

Post by peterdines »

Thanks for the replies - all the settings look correct - does anyone have an example of a Base database form with a working subform? Maybe I need to see a working one to use as a model.
OOo 3.3 / Mysql / Postgres / OS X 10.6.5
User avatar
kabing
Volunteer
Posts: 680
Joined: Fri Nov 23, 2007 12:05 am
Location: Midwest, USA

Re: Can't change or add records in subform?

Post by kabing »

Is the subform based on a table or a query? Does the subform table include a primary key?

kabing
NeoOffice 2022.7 LibreOffice 24.8.4 on (Intel) Mac OS Ventura
User avatar
peterdines
Posts: 42
Joined: Thu Nov 06, 2008 9:06 am

Re: Can't change or add records in subform?

Post by peterdines »

Months later I had time to come back to Base development - problem was indeed no primary key in the subform. You are correct, sir!
OOo 3.3 / Mysql / Postgres / OS X 10.6.5
User avatar
kabing
Volunteer
Posts: 680
Joined: Fri Nov 23, 2007 12:05 am
Location: Midwest, USA

Re: Can't change or add records in subform?

Post by kabing »

I'm glad you found an answer, but I'm not a "sir." No way for you to know that, of course.

kabing
NeoOffice 2022.7 LibreOffice 24.8.4 on (Intel) Mac OS Ventura
Post Reply