Jim Hewson
jm.hwsn at gmail.com
Tue Jul 27 11:53:16 CDT 2010
I'm not sure what you're trying to do.
Please explain what you are attempting to do.
To me, I don't know why you would put "Stop" at the beginning of the sub.
Stop suspends the code so it doesn't progress any further. You then attempt
to open a different form, maximize the current form and set focus to an
object on the current form. You then Dim several variables, then turn off
the warnings.
I would think that opening one form when you open a form would give you an
error message.
I also think you would probably get another error message when you attempt
to set focus on an object that is not on the second form. I think the
maximize command is ineffective because it doesn't apply to the form that is
being opened, but the form you attempted to use it on has already lost its
focus, so it won't work there either. None of the Dim variables have
anything to do, so they are taking up code space for no apparent reason.
The Warnings have been turned off, I wouldn't do that unless there are some
messages I don't want to see. One example is an update query where I know
how many rows will be updated.
Just my musings, I would be interested in what you're trying to do and how
the second form relates to the first.
Jim
-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Kaup, Chester
Sent: Tuesday, July 27, 2010 11:17 AM
To: Access Developers discussion and problem solving
Subject: [AccessD] Unknown Jet Error
Why does this code cause an error? Compact and repair is of no use.
Private Sub Form_Open(Cancel As Integer)
Stop
DoCmd.OpenForm "frm Plant Pressures Scatter"
DoCmd.Maximize
Me!chtPlantChart.SetFocus
Dim frm As Form, ctl As Control
Dim varItm As Variant, intCnt As Integer
Dim MaxY1 As Single, MaxY2 As Single, MajorUnitY1 As Single
Dim MinorUnitY1 As Single, MajorUnitY2 As Single, MinorUnitY2 As Single
DoCmd.SetWarnings Off
End Sub.
Chester Kaup
Engineering Technician
Kinder Morgan CO2 Company, LLP
Office (432) 688-3797
FAX (432) 688-3799
No trees were killed in the sending of this message. However a large number
of electrons were terribly inconvenienced.
--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com