[AccessD] Unknown Jet Error

Gary Kjos garykjos at gmail.com
Tue Jul 27 12:51:32 CDT 2010


So this code is in the on open event of one form and it's attempting
to open another form?

Generally I would suggest commenting out the code that is not needed
to get down to the issue that is really failing. Simplify to make it
simpler to focus on what the actual problem is.

As Jim pointed out in an earlier post on this, all the DIM statements
you have included are irrelevant to the process and so should be
removed or commented out to get them out of the way.

I would think that opening another form while in the process of
opening one form could be problematic.

GK

On Tue, Jul 27, 2010 at 12:43 PM, Kaup, Chester
<Chester_Kaup at kindermorgan.com> wrote:
> Yes I will agree it is a mess of code. I am by no means a professional coder. Some of this came from an old form. It is only part of the code.
>
> Anyway let me start from the beginning of the story
>
> The form I am working with contains a chart that has hourly data points for the last six days. The chart likes to auto scale the x axis for seven days . The scale starts one day before the actual data.
>
> My attempts to work with the chart were not successful so I thought I would change the x axis scale of the chart using VBA. My plan was to retrieve the minimum axis value and then change it. I am still unclear on how to retrieve it.
>
> The stop is temporarily in the code so when the form opens I can walk through the code.
>
> I have manipulated the graph axis in the past with code.
>
> -----Original Message-----
> From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Jim Hewson
> Sent: Tuesday, July 27, 2010 11:53 AM
> To: 'Access Developers discussion and problem solving'
> Subject: Re: [AccessD] Unknown Jet Error
>
> 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
>
>
> --
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
>
>
> --
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
>



-- 
Gary Kjos
garykjos at gmail.com




More information about the AccessD mailing list