How to edit records in query results

Asked by FreedomEagle

I am working on a database which I will need to query for certain results and edit some of the records. A similar example would be a checkbook register where I could query for all unbalanced entries and then in the results check off any that have cleared. I am unable to find a way to edit the results.

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu openoffice.org Edit question
Assignee:
No assignee Edit question
Solved by:
Tony Pursell
Solved:
Last query:
Last reply:
Revision history for this message
Bhavani Shankar (bhavi) said :
#1
Revision history for this message
Tom (tom6) said :
#2

Hi :)

I think the question is are you trying to edit the query itself or edit the data contained in the query? Also is it a relational database, with many tables linked together to produce an output in a query or is it a normal (default) flat single table with the query simply providing a useful lookup based on selected criteria?

I am not sure which of those thing Voobase's answer addresses
"They should do by right clicking on them and choosing edit. Check you have the HSQL database by looking at the bottom of your dB window and that you are not accessing your db file twice. HSQL only allows one user to have write access at once. For multiple users you need to link Base to a different backend like MySQL. Also do you have an auto incrementing primary key? "
as it has been many years since i last used MS Access which is the most similar thing i have used to Base. Please try right-click on the bit you want to edit and let us know if that has the desired effect.

Regards from
Tom :)

Revision history for this message
Tom (tom6) said :
#3

However if you are trying to develop a personal finance (or even business finance) package then have you looked at "gnucash"?

I would use Synaptic Package Manager
https://help.ubuntu.com/community/SynapticHowto
to look up and possibly install financial management package, bookkeeping packages and stuff like that to see if there's something already done that you could use as a good starting point.

Alternatively for the tick-box approach that you mentioned you might have to include a column in the table that has the list of cheques in. I imagine that Base must be able to have a standard "Yes/no", "On/Off" binary style field that wouldn't add tooo much extra to the tables 'weight'

Good luck and regards from
Tom :)

Revision history for this message
Tony Pursell (ajpursell) said :
#4

You can create a Query (using Create Query in design view is quite easy) that will select only data you need to see for unbalanced entries. Then if you double click the Query to open it, you will find that you can edit the data in it, and when you close it, the changes are written back to the underlying base table.

You could also create a Form that you can modify the data in.

There is some documentation about Base, but it is not a comprehensive as for other parts of OOo. See:

http://documentation.openoffice.org/

or more specifically:

http://wiki.services.openoffice.org/wiki/Documentation/OOoAuthors_User_Manual/Getting_Started/Getting_Started_with_Base

However, I agree with Tom that you should look at ready made applications, like gnucash, before you re-invent the wheel!

Tony

Revision history for this message
FreedomEagle (zpaqmf) said :
#5

Is there something I need to do when creating the query to allow me to edit the records that it finds? Tony makes it sound like it should already do it but it does not work. In this particular case I am querying one table to pull out only records that are not marked as finished. I want to be able to check off some of them right in the results and have the base table be updated. As far as gnucash, I just used the checkbook as an example of the specific function I need to do since it was easier to explain. I know how to edit the query that is not the issue.

Revision history for this message
Tony Pursell (ajpursell) said :
#6

I will admit that I tested this in Windows XP, but there is usually no difference.

I also assume that your data source is the default HSQLDB used by Base and not MySQL or a spreadsheet, for instance. I was also using OOo ver 3.

The test database I used was an address list for Xmas cards. My query was a simple single table select where 'type' = 'family' and I was able to change the 'label' field from 'Y' to 'N', both by opening the query, or by creating a simple form.

Does your test case differ significantly from this?

Revision history for this message
Tony Pursell (ajpursell) said :
#7

I have just retested in Ubuntu 9.04 (on my trusty EEEPC). Everything the same as I described for XP. Does work just the same.

Have you checked the file permissions on the odb file? I assume it has to be read/write for you.

Tony

Revision history for this message
Best Tony Pursell (ajpursell) said :
#8

Thanks for emailing your database to me.

I think I know what you have to do now to make fields editable through a Query.

Right click on the Query and select Edit. Double click TaskID (the Primary Key) to add it to the query definition. Now when you open the query by double clicking it, you should find that you can edit the fields.

If you want to hide the TaskID, right click on the column heading while you have the Query open and click Hide Columns. Don't try and hide it by unchecking 'visible' while editing the query in Design mode as this will just render the fields uneditable again.

Tony

PS If this answers your question, please mark it as solved.

Revision history for this message
FreedomEagle (zpaqmf) said :
#9

Thanks Tony Pursell, that solved my question.