| View previous topic :: View next topic |
| Author |
Message |
sambalpedas General User

Joined: 04 Sep 2008 Posts: 5
|
Posted: Thu Sep 04, 2008 1:12 pm Post subject: Cannot insert new records in forms |
|
|
I am trying to get to work my first database with base using the HSQL engine and now I get this problem:
I have created my first tables and queries and now I am working on the first form. I can see there the records which I have inserted in the tables, but I cannot create any new records. The button for new records is faded out, even though the functions "allow additions, modifications and deletions"are all on "yes".
I can browse through my previous records without problems and I can create new records in the tables.
What could be my problem?
Thanks in advance for your help
sambalpedas |
|
| Back to top |
|
 |
Voobase OOo Advocate


Joined: 21 Nov 2007 Posts: 400 Location: Australia
|
Posted: Sat Sep 06, 2008 6:16 am Post subject: |
|
|
Hi there,
In Base, if you use a query as a datasource for your form it becomes read only. The form must use a table as its data source.
You can create subforms as well as mainforms and create joins between the two so that they act a bit like a query. You can join a table based subform to a query based mainform but only changing of the data would be allowed in the subform.
If it wasn't this please let us/me know.
Cheers
Voo |
|
| Back to top |
|
 |
sambalpedas General User

Joined: 04 Sep 2008 Posts: 5
|
Posted: Sun Sep 07, 2008 12:41 am Post subject: |
|
|
Thanks for your answer.
Yes, I did use a query as base for the form. But I don't think, this is the problem. I have tried to make a form from a query using the wizard and it works. But I could not find out, what makes the difference between these two forms. Why does one work and the other one doesn't.
Any other ideas?
sambalpedas |
|
| Back to top |
|
 |
Wandering OOo Enthusiast

Joined: 18 Oct 2007 Posts: 190
|
Posted: Sun Sep 07, 2008 11:59 am Post subject: |
|
|
The contents of a query may not define a specific record in all linked databases. It could for instance show one company name with fifty employee names. When changing the form, Base would have no way to know which of the records to modify, or if it would be safe to modify any of them.
The query should contain the key fields for each table, and should define only one record from each. Then you can modify from the form. At least that's as far as I got.
Good luck! |
|
| Back to top |
|
 |
sambalpedas General User

Joined: 04 Sep 2008 Posts: 5
|
Posted: Mon Sep 08, 2008 1:34 am Post subject: |
|
|
This might point in the right direction. I still have to think about it to fully understand.
Thanks
sambalpedas |
|
| Back to top |
|
 |
sambalpedas General User

Joined: 04 Sep 2008 Posts: 5
|
Posted: Mon Sep 08, 2008 12:20 pm Post subject: |
|
|
Yes, I do use data from two related tables which I link in a query. One table has products and the other one colors.
I want to use the form to enter new products and one of the fields in the form is a combo-box, where I want to choose an existing color or add a new one.
The existing records are shown correctly, but I can't ad new ones.
I still don't see what is wrong.
sambalpedas |
|
| Back to top |
|
 |
sambalpedas General User

Joined: 04 Sep 2008 Posts: 5
|
Posted: Sun Nov 09, 2008 1:30 pm Post subject: |
|
|
| Voobase wrote: |
In Base, if you use a query as a datasource for your form it becomes read only. |
After a lot of trying, I get to the conclusion, that most probably this statement was right and my book (which is otherwise very good) is wrong on that point.
Now I am trying to work with tables, what makes it more difficult to avoid redundancies in the forms, but it seems to be the only solution.
Thanks
sambalpedas |
|
| Back to top |
|
 |
|