OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

Adding items

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Base
View previous topic :: View next topic  
Author Message
yo5bdm
General User
General User


Joined: 23 Mar 2010
Posts: 9
Location: Baia Mare, Romania

PostPosted: Tue Mar 23, 2010 9:34 am    Post subject: Adding items Reply with quote

Hello there to all of you. This is my first post here, but I've been watching this forum for a while and you guys are making a GREAT job! Many of my questions were solved even without registering here!

But now I have a question/problem. I want to make a small application that will generate proforma invoices. For this I would like to know if it is possible to add to an existing table some items (full rows) from another table/query.
Also I tried some tricks found on the web for opening a form from a button (a so called "Generate Invoice" button), but all of my attempts to use Macro's were failures, even after copy-paste'ing the right code, and doing the tutorials step by step. Does anyone know an easy and working method?

I am using Windows XP and OO 3.2 (the latest & updated).

Thank you very much for your time and help. ooBase is my first encounter with database management software. I am extremely pleased with what it can do.

Until next time,
Best regards
_________________
Intuition is an exact science!
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
Sliderule
Super User
Super User


Joined: 29 May 2004
Posts: 2499
Location: 3rd Rock From The Sun

PostPosted: Tue Mar 23, 2010 10:33 am    Post subject: Reply with quote

yo5bdm:

Welcome to OpenOffice Base.

You asked:

yo5bdm wrote:
For this I would like to know if it is possible to add to an existing table some items (full rows) from another table/query.

The answer is, yes, it is possible.

This is done, by using an SQL statement . . . INSERT. For documentation on using an INSERT statement with HSQL ( the embedded OpenOffice database engine ) . . . please review the following link:

http://www.hsqldb.org/doc/guide/ch09.html#insert-section

Let me give you an example . . . the table I want to add NEW records into is named "MyTable" . . . and . . . the table that contains the data data is named "MyOtherTable", so, the steps would be:
  1. Open your OpenOffice database file
  2. From the Menu: Tools - SQL...
  3. In the Command to execute box, add the SQL statement, for example:

    Code:
    INSERT INTO "MyTable" Select * From "MyOtherTable"

    You can use whatever Select SQL is needed, including a a Where clause that you have defined

  4. Press the Execute button
  5. Command successfully executed. should be displayed, assuming everything works ( the names you suppled are correct ) Smile
  6. Press the Close button

I hope this helps, please be sure to let me / us know.

Sliderule

Thanks to add [Solved] in your first post title ( edit button ) if your issue has been fixed / resolved.
Back to top
View user's profile Send private message
yo5bdm
General User
General User


Joined: 23 Mar 2010
Posts: 9
Location: Baia Mare, Romania

PostPosted: Tue Mar 23, 2010 11:26 am    Post subject: Reply with quote

Hello sliderule and thanks for your quick reply. Unfortunately this is not what I had in mind. I have some limited knowledge about SQL and I knew about the insert command, but I want to do this with forms. Let's say on one form I have a table containing part numbers mounted on a car and I want to transfer from that table that contains parts that are invoiced to the client. With the part number I need the description and price. Is this possible?


Also, about the opening of forms from another form, what can you say?
_________________
Intuition is an exact science!
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Base All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group