Date: prev next · Thread: first prev next last
2014 Archives by date, by thread · List index


Le 17/12/2014 03:05, Joel Madero a écrit :

Hi Joel,

I have a form that has bookID as a unique key. I want to have a button
that is to open a second form and do the following:



(1) search for the bookID in another table (Series);
(2) If bookID does not exist in Series, create a new record that has the
bookID and open another form and passes the bookID to that form so I can
enter the appropriate info.



My own take on this, as I had something similar setup a long time ago,
was to have a button that activated a macro which :

- checked whether a value existed in another table via a parameterized
query,
- if the ID didn't exist, constructed and fired an INSERT statement to
insert a new value into that table (either automatically if it was
autoincrement, or using a previous last_insert_id() function to query
the id counter and add 1 to it to create my new counter value ;
- then return the inserted value and display it to the user via a
message box.

Alternatively, I guess I could've caused a second form to open up after
successful completion of the INSERT statement, but that isn't what I needed.

Not quite sure why you need to open a whole set of other forms though,
as the value you obtain for BookID could be inserted programmatically
without going through forced UI steps (unless that is what you want for
some particular reason)


Alex


-- 
To unsubscribe e-mail to: users+unsubscribe@global.libreoffice.org
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.