The first thing you should do is make the SB form as the default form to open when you start the database. What you should do is open the menu Tools-->Startup. In 'Display Form/Page' you should enter the name of your SB-form (if you want you can enter an application title too, but this is not required). Accept the change by pressing enter.
Now when you open your database the form you entered here will open automatically. From this form you can navigate using the action buttons you created. I guess you know how to create the action buttons... To make sure your SB-from closes when you press the action button to open another form, you have the make a little change to the VBA of this action button. This is how you should do this:
go to design view --> right click on the action button --> properties --> select the event tab --> where you have 'on click' there will be written [Event Procedure], select this line and press the '...' at the end of the line --> a new window will open, your VBA procedure of this button is the one on which the selector is located. It will look something like this:
private sub ABC_click()
on error goto err_ABC_click
docmd.close
dim stdocname as string
dim stlinkcriteria as string
stdocname = "name of the form you want to open"
docmd.openform stdocname, , , stlinkcriteria
exit_ABC_click:
exit sub
err_ABC_click:
msgbox err.description
resume exit_ABC_click
end sub
I have used ABC because I don't know what name you gave to your action button, so it won't be ABC in your database, but the name you gave to this button. The docmd.close command will not be in your code, but you have to add it. This will make the current form (the SB-form for exemple) to close. (it makes the form on which the action button is located to close to be more exact) The rest of the code makes your other form to open. Then you just save the change in your code and exit this window. You will have to repeat this with every button you made, so if you have 20 buttons to navigate between your forms and you want them to close every time, you have to add the docmd.close on every one of these 20 buttons...
Is it this you are looking for, or do I not understand exactly what you want?
|