You have to write code to display the UserForm. If you gave it the name
frmTest, then the code would be:
Load frmTest
frmTest.Show
You could, for instance, write this code in in a module that you name
AutoExec. This name means it will play every time you open the database, and
so your UserForm would be shown every time the database is opened.
You could also, alternatively, attach this code to an event in a normal
Access form. In Design mode, right-button click the normal Access form,
select Properties, select Event, click on the event you want to attach the
code to. Then click the button with 3 dots that will appear at the right of
that event line, and select 'Code Builder'. Write those two lines of code on
the page that will appear.
To close the UserForm, you could add to it an OK command button, name it
(for instance) cmdOK and write these lines on the code page of your UserForm:
Private Sub cmdOK_Click()
frmTest.Hide
Unload frmTest
End Sub
I like to employ those UserForms because I'm accostumed to their features,
which I used a lot in MS Word and Excel. But the normal Access forms have
their own features, which are also very comprehensive, and you can use them
as pop up forms (in Design mode / Properties / Other, select 'Yes' in front
of 'Pop up').
So if you are familiar with the normal Access forms, it might be that
employing the VB UserForms doesn't add much - I don't know, that's for the
experts here to say.
Matt Vilhena
-----------------------