I have just started experimenting with the database. Have created a table, a query and a form tied to the query. Have added some data into the table. When I open the form it will not allow me to add or edit data to an existing record. What control have I not set correctly to allow new/edit old data in a record?
Thanks
Paul
[Solved] Adding/editing data
[Solved] Adding/editing data
Last edited by paulb on Mon Dec 08, 2008 10:01 pm, edited 1 time in total.
OOo 2.3.X on Ms Windows XP
Re: adding/editing data
First, what type of database is indicated in the status bar? HSQL?
Right-click the form and "Edit..."
View>Toolbars>Form Design
Push 5th button "Form Navigator" and get the properties of the form.
What is the content of tab "Data"?
In case of some table: Is the table editable when you open it directly? (does it have a primary key)
In case of a stored query: Is the stored query editable when you open it directly? (that depends on several preconditions)
In case of an SQL-string (a query stored within the form): Push the [...] button next to the SQL string and the test-button (green check-mark) in order to see the query result in a grid view. Is that editable?
You can view any query in SQL view ("database command line") and paste the string into this forum.
If the form's underlying record set is editable: There are also restrictions on form level accessible on the same properties dialog ("allow modification", "allow deletion", "allow new records",...)
Right-click the form and "Edit..."
View>Toolbars>Form Design
Push 5th button "Form Navigator" and get the properties of the form.
What is the content of tab "Data"?
In case of some table: Is the table editable when you open it directly? (does it have a primary key)
In case of a stored query: Is the stored query editable when you open it directly? (that depends on several preconditions)
In case of an SQL-string (a query stored within the form): Push the [...] button next to the SQL string and the test-button (green check-mark) in order to see the query result in a grid view. Is that editable?
You can view any query in SQL view ("database command line") and paste the string into this forum.
If the form's underlying record set is editable: There are also restrictions on form level accessible on the same properties dialog ("allow modification", "allow deletion", "allow new records",...)
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Re: Adding/editing data
Type of database - HSQL
On Form data tab -
Content Type - Query
Content Query_tblTeacher
Analyze SQLContent - yes
Allow Additions - yes
Allow Modifications - yes
Allow Deletions - yes
Add Data only - no
Naviagation Bar - yes
Cycle no
Table is editable
Query is not editable - I assume that is the problem.
I do not follow waht you are saying about SQL-string
Thanks Paul
On Form data tab -
Content Type - Query
Content Query_tblTeacher
Analyze SQLContent - yes
Allow Additions - yes
Allow Modifications - yes
Allow Deletions - yes
Add Data only - no
Naviagation Bar - yes
Cycle no
Table is editable
Query is not editable - I assume that is the problem.
I do not follow waht you are saying about SQL-string
Thanks Paul
OOo 2.3.X on Ms Windows XP
Re: Adding/editing data
The problem is not related to the form. The form is based on a record set which is not editable for some reason. Get the querie's SQL-string ("Edit in SQL view") and paste it here.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Re: Adding/editing data
Is this what you requested:
SELECT "name" AS "name", "grade" AS "grade", "course" AS "course", "course #" AS "course #", "comments" AS "comments", "addcomments" AS "addcomments", "FN" AS "FN", "LN" AS "LN", "STudID" AS "STudID", "teacher" AS "teacher" FROM "tblTeacher" ORDER BY "name" ASC
Paul
SELECT "name" AS "name", "grade" AS "grade", "course" AS "course", "course #" AS "course #", "comments" AS "comments", "addcomments" AS "addcomments", "FN" AS "FN", "LN" AS "LN", "STudID" AS "STudID", "teacher" AS "teacher" FROM "tblTeacher" ORDER BY "name" ASC
Paul
OOo 2.3.X on Ms Windows XP
Re: Adding/editing data
Simply an ordered list from single table "tblTeacher" which is editable, I suppose. A record set can not be editable unless the primary key is included. The database engine has no evidence about the uniquely distinguishable rows. Without PK it's an unstructured hash of data. I think, you left out the primary key because it is an auto-value which does not deserve to be visible on a form.
Try this instead:
which simply selects all the fields. Now your form operates on a writable record set, even if there is no visible control representing the primary key. No need to edit the form.
Try this instead:
Code: Select all
SELECT * FROM "tblTeacher" ORDER BY "name" ASC
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice