General information
Category:
Forms & Form designer
Was your question answered? It sounds to me like you are asking how to get the name of the field into which to insert the value of the next primary key.
If I understand you correctly, one way you can do it is to pick a field name such as "PK" and use that name as your primary key in all your tables by convention. Then you can even make your INSERT generic - or APPEND BLANK, REPLACE PK WITH NextKey() which will work regardless of the alias name.
If your are looking for a function that returns the name of the primary key expression, there's probably something in DBGetProp, or maybe you can write a loop through all the fields in the table to test for it until you find it.
Another thing you may consider, instead of using one record for each table, if the total number of records in all your tables will be less than 2 billion, is to just have a table with one field (the next meaningless number to use as a unique ID), and one record. E.g., if you add a customer and an inventory item, the customer's ID might be 10003 and the inventory item's ID might be 10004.
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only