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: [email protected]
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

Reply via email to