how do i make a start up form like northwind?

S

sgthatch2

pleas help ive loked at northwind but cant figure out how it works. i want
to be able for it not to ask me to never show it again
 
D

DM

are you talking about a form that will pop up once (the first time you open
the database)?
 
A

Albert D. Kallal

Actually, the approach they use is quite complicated and convoluted.

The check box they use is UN-bound.

When you click the box (to set, or un-set) the check box, when you CLOSE the
form, code is RUN TO SET the startup form in the database properties.

Remember, if you unchecked this box, then some other form has to run so the
user sees something at startup time.

In a sense that complicated problem they are solving is not that you don't
wanna show the form again, but if you check that box, then they have to
write a budget code to set up and make sure that the user sees some other
form at startup.

if I just had a form that was supposed to launch and give the users some
information that I only want them to see once, then I would simply build a
form and bind it to a one record table with a field for the check box. This
approach means that the form could remember if it's posted display or not.

Thus, the bound check box idea in which we use a table to save the status
value value of the check box is a far more simple approach to hide a form. I
cannot stress again at the complex problem is not simply having a check box
to hide a form, but setting up code to launch some other form in its place.

The check "bound" check box idea is simply, and you simply would go in the
on-open event:

if me.CheckBoxDontShow = true then
cancel = true
end if

the question you'll have to answer here for a proper solution to your
question is if the person checks the box, do you want an alternate form to
display?

If yes, you could go:

if me.CheckBoxDontShow = true then
docmd.OpenForm "nameofAlternateForm"
docmd.closeform acForm,me.name
end if

The above code would give you essentially the same effect. Anyway, folwling
my signature below is a cut and paste of the north wind code that is used to
set the startup properties of the database.

I should add I think the NorthWind approach is a bit too complex of a
solution, but it does actually set your startup properties in your database
if that's your final goal here.

--
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada
(e-mail address removed)

Function HideStartupForm()
On Error GoTo HideStartupForm_Err
' Uses the value of HideStartupForm check box to determine the setting for
' StartupForm property of database. (The setting is displayed in Display
Form
' box in Startup dialog box).
' Used in OnClose property of Startup form.
If Forms!Startup!HideStartupForm Then
' HideStartupForm check box is checked, so set StartupForm property
to Main SwitchBoard.
CurrentDb().Properties("StartupForm") = "Main SwitchBoard"
Else
' HideStartupForm check box is cleared, so set StartupForm
property to Startup.
CurrentDb().Properties("StartupForm") = "Startup"
End If

Exit Function

HideStartupForm_Err:
Const conPropertyNotFound = 3270
If Err = conPropertyNotFound Then
Dim db As DAO.Database
Dim prop As DAO.Property
Set db = CurrentDb()
Set prop = db.CreateProperty("StartupForm", dbText, "Startup")
db.Properties.Append prop
Resume Next
End If
End Function
 
J

Joe D

if I just had a form that was supposed to launch and give the users some
information that I only want them to see once, then I would simply build a
form and bind it to a one record table with a field for the check box. This
approach means that the form could remember if it's posted display or not.

Thus, the bound check box idea in which we use a table to save the status
value value of the check box is a far more simple approach to hide a form. I
cannot stress again at the complex problem is not simply having a check box
to hide a form, but setting up code to launch some other form in its place.

The check "bound" check box idea is simply, and you simply would go in the
on-open event:

if me.CheckBoxDontShow = true then
cancel = true
end if

the question you'll have to answer here for a proper solution to your
question is if the person checks the box, do you want an alternate form to
display?

If yes, you could go:

if me.CheckBoxDontShow = true then
docmd.OpenForm "nameofAlternateForm"
docmd.closeform acForm,me.name
end if



Hi Albert, I like your idea but can't seem to implement it. Could you explain what you do in a little more detail please. The one field table you create, is that called CheckBoxDontShow or is the field?

And you use the option group tool to create the check box and have it bound to the field right?

Thanks in advance
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top