One to one question and form use with same

Database 1 to 1 design and popating a combo box question?
So I have a database that stores information about firearms. A table " Guns" which believe it or not has info about guns

?

i would use a listbox and search field. you can store your database table id or a class object into the RowTag.
new/edit/update data via a form with some fields.
i use id =0 to indicate that a new record was input.

here is a example to use a listbox with many data:
lazy-loading-data-with-listbox

if you have a desktop project with local database.
SQLiteDatabase

Thanks Markus. Would you break apart the guns table into 2 tables and use another table called gunType?

i am not a fan of linked tables, i like object serialization and not databases.
you could use a enumeration in xojo but u need to assign a value for each or xojo auto generate new number if you change the enum.
you can use GunTypeId, a Enum Value or a String.
with extra table you should setup foreign key.
i choose what is best and easy to use - also something that is not problematic in future.

In relational database design, when you find that an entity (a row) is related to one and only one row in another table, this is called a 1 to 1 relationship. It is usually a sign that you do not need to have a relationship with that other table. Rather, you make that one related item a “field” or “property” of the entity in the first table.

An example: suppose every object “gun barrel” has one and only one “serial number” stamped on it.
There is no need to “relate” to a serial number table. You would make “serial number” a property of the “barrel” object.

I’m assuming that you might be using a ComboBox for the user to select a value from a list of different standard options. For example, for a new gun record in the “Gun” table, select a value for the type of gun from the ComboBox where the following are displayed:

Pistol
Shotgun
Rifle

You will need a “GunType” table populated with “Pistol”, “Shotgun”, “Rifle” , etc. You will populate the ComboBox rows with the unique values in the “GunType” table. When the user enters data for a new gun in a “Gun” table, his selection from the ComboBox is recorded as a property of the “Gun” record.

Importantly, there is no need for a one to one relationship between the tables.

Hi craig. Makes total sense.
I really appreciate ut. With the gun type table I can add more types in the future as well auch as black poweder, speer gun, etc.
Thanks.
Regards kind sir.

Markus. Sie sind Deutsch?
Ich hoffe, eines Tages Deutschland, insbesondere Bayern sowie Auatria und die Schweiz zu besuchen.
Ich habe viele deutsche Freunde in einer Facebook-Gruppe.
Entschuldigen Sie mein schlechtes Deutsch
Ich benutze Google, um zu helfen.

[quote=493563:@Markus Rauch]i am not a fan of linked tables, i like object serialization and not databases.
you could use a enumeration in xojo but u need to assign a value for each or xojo auto generate new number if you change the enum.
you can use GunTypeId, a Enum Value or a String.
with extra table you should setup foreign key.
i choose what is best and easy to use - also something that is not problematic in future.[/quote]

OT

[quote=493593:@Tim Lee]Markus. Sie sind Deutsch?
Ich hoffe, eines Tages Deutschland, insbesondere Bayern sowie Auatria und die Schweiz zu besuchen.[/quote]
Ja aber wohne in Nord Deutschland, Bayern mit den Bergen ist toll.
In past i looked at google maps and made a gps list for visiting all this nice places there.

This makes this threat a bit off-topic…
But I do the same thing. As cameraman I travel all over Europe. When I work at interesting places I would like to revisit, I open Google Maps, add a star-marker. Bayern is awesome indeed!