Database Sub-Forms

Hi everyone.

Here’s the next post in my database series. Today, I’m going to cheat a little, because there’s no point in re-inventing the wheel, is there? There’s an excellent video on YouTube about how to create sub-forms, which was the topic I promised to cover next.

Once you’ve watched this, you’ll understand why I introduced you to the Form Navigator last time, because you’ll be using it a lot if you create sub-forms. For anyone who remembers that you can create a sub-form using the Form Wizard, that’s true, but it only lets you create one sub-form. You can create more than one using the method shown here.

So, this is more-or-less how I created my main form.

LibreOffice Database Form

The only difference really was that I created the Main Form using the wizard, because that was quicker, and I added the Sub-Forms by the method in the video afterwards.

My Main Form is my Book, which has a Sub-Form of the individual Scenes, and all the other forms (Character, Place, Facts) are Sub-Forms of Scenes. (This is what he does at the end, but I created mine from the start so didn’t need to do all the fiddling around to change the form.) You’ll see he adds in all the IDs on the forms so that he can check that the records are working correctly. I haven’t done this and once you know what you’re doing I don’t think it’s really necessary because you know what you’re looking at.

On another point, I mentioned Update and Delete Cascades before. I’ve changed mine all to not allow Delete Cascade because I had an issue where I forgot where I was in the database and deleted something by mistake. Luckily, it wasn’t something that had much impact at all, but it could have been. So, I think it’s safer for me to not allow deletes like that.

Anyway, next time I think it might be posting about how to create buttons to open your forms (that’s another video but with some changes!).

See you then.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s