[Solved] Adding records to table in subform

Creating and using forms
Post Reply
cscj01
Posts: 32
Joined: Wed Apr 02, 2008 12:45 am

[Solved] Adding records to table in subform

Post by cscj01 »

I have a main form and one subform in my OOo Base form. The subform is a table, and the first column is defined in my MySQL database as Auto Increment.

If I have existing data in the table of my subform linked to my main form, the main form and the subform display correctly. However, if I want to add rows via my subform and there are no existing rows in my subform table, the first colum shows <AutoField>, I can enter data in the columns of my subform table, but the navigator bar is grayed out, and I cannot enter the data. The main navigator bar is also grayed out at this point.

I have checked the permissions for the subform table, and they allow additions, updates, and deletions. The navigator bar is yes, and the link fields are populated correctly.

Any help will be appreciated.
Last edited by cscj01 on Sun Apr 27, 2008 6:51 pm, edited 1 time in total.
cscj01
Posts: 32
Joined: Wed Apr 02, 2008 12:45 am

Re: Adding records to table in subform

Post by cscj01 »

Here's another problem I am having with a table in a subform.

In MySQL, the table in the subform has 2 columns, and both constitute the primary key of the table. The two columns are both type integer with a default value of 0.

In the main form, I can navigate to a particular record, and if the table in the subform has a corresponding record, it is displayed. If there are no records, the first column (the join column) has the correct value from the table in the main form in it and the second column has no value. If i retype the value in the first column and enter the new value in the second column, a row is added to the subform table with 0 in the first column and the new value in the second column.

It seems that the default value from MySQL is overriding what I enter. Why is this?
cscj01
Posts: 32
Joined: Wed Apr 02, 2008 12:45 am

[Solved] Re: Adding records to table in subform

Post by cscj01 »

I have this working thanks to the work of JD in the (Unofficial) Open Official Forum. The fact is that OO doesn't like unsigned integers, and since my keys were auto-generated, I saw no need to use signed integers when I set up my DB. If you care to read of our path to resolution, here's the link: http://www.oooforum.org/forum/viewtopic.phtml?t=70225. Nuff said.
Post Reply