Start up Form Help

MOTOWN44

Registered User.
Local time
Today, 10:36
Joined
Aug 18, 2009
Messages
42
Hi guys

Is it possible to have a form that appears at start up unless a parameter is set to true, in my case a tick box on the form.

The form is a notice of changes that have been made the problem with this being that people only need to read it once and I cant remove it because about 800 users will have separate copies of the front end on there pc’s.

My current train of thought is that I have a small table on the front end with a yes/no field which is linked to a tick box in the form. When the box is ticked to say that the user no longer wishes to see this on start up the form either no longer opens or starts as hidden.

The code for this I imagine is very simple I've been messing in the OnLoad part of the form.

Private Sub Form_Load()

If ([TickBox] = True) Then
activewindow.Visible = False
End If
End Sub

I did have it working with DoCmd.Close in the OnTimer but I constantly had the form flickering on the screen.

Hopefully there is a better way!?

Thanks in advance,
 
On your timer event

Me.TimerInterval = 0

This will stop the timer from repeating itself every time you originally specified it.

Another solution is as follows

in a standard module create a function

Code:
Public Function ShowStartUpFormOnOpen()

Dim sText As String

If Dir(CurrentProject.Path & "\ShowMe.Txt") <> "" then

   Open CurrentProject.Path & "\ShowMe.Txt" For Input As #1
   Line Input #1, sText
   Close #1
Else
   sText = "Y"
End If

If sText = "Y" Then
   DoCmd.OpenForm "YourFormName"
End If

End Function

This checks for the existance of a text file in the same folder as the application, if it exists it reads in the first line, and if it is a "Y" it will open the form.

The next step is to have a check box on your start form that says

Show form at start up

Then on the close of the form

Code:
   Open CurrentProject.Path & "\ShowMe.Txt" For Output As #1
   Print #1, Iff(Me.ChkShowMe = True,"Y","N")
   Close #1

This creates the file if it does not exist or changes the value to Y or N depending on the users response.

Using this method you do not need any tables in your mdb and it is unique to each workstation.

David
 
Hi
Thanks for your help.

Do I have to add the file name and path in the code? I have created the module simply called module1 and changed the form name part to “ForceBox3” which is the name of the start up form.
I have also added the other code to the OnClose event of the form “ForceBox3”

Are there any other variables I need to change as the text box isn’t created on my desktop where the frontend is currently located.

Im pretty new to VB and only know basic functions so if ive missed anything I needed to change if you could give me a nudge in the right direction that would be great J

Thanks
Matthew
 
Hi
Thanks for your help.

Do I have to add the file name and path in the code? I have created the module simply called module1 and changed the form name part to “ForceBox3” which is the name of the start up form.
I have also added the other code to the OnClose event of the form “ForceBox3”

Are there any other variables I need to change as the text box isn’t created on my desktop where the frontend is currently located.

Im pretty new to VB and only know basic functions so if ive missed anything I needed to change if you could give me a nudge in the right direction that would be great J

Thanks
Matthew
 
Right ive narrowed down what i think is the problem.
it doesnt recognise the bit in red below i keep getting an error message saying compile error: method or data member not found

Private Sub Form_Close()
Open CurrentProject.Path & "\ShowMe.Txt" For Output As #1
Print #1, Iff(Me.ChkShowMe = True, "Y", "N")
Close #1
End Sub

Thanks
 

Users who are viewing this thread

Back
Top Bottom