INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Form will not open

Form will not open

(OP)
I have been using a form for years with no problems. And, I have made no changes to the form or the on current VBA event. Now, every time I try to open it, Access crashes and is forced to restart. The odd thing is I can open the on current event for the form, put a {F9} to stop the VBA. When the execution reaches the {F9}, it stops. I can then press {F5} and the form will open with no further intervention.
All I am doing is stopping the VBA in the middle and then restarting from that point and it works correctly. It doesn't seem to matter where I insert the stop.
Any ideas would be appreciated.

RE: Form will not open

Probably would be a good idea to post the OnCurrent code, so we can see what it does! Problems that can be resolved by stopping execution, part of the way through, then continuing execution, generally have something to do with timing, but without knowing what the code is doing it's hard to say.

Hope this helps!

There's always more than one way to skin a cat!

All posts/responses based on Access 2003/2007

RE: Form will not open

(OP)
Thanks for your help. I managed to fix it. All I did was copy the code to a word document and erase the procedure in VBA. I then saved and closed the db. When I reopened the db, I pasted the copied code back into the ONCURRENT event. It worked. I have no idea why but it works. I would be interested in anyone's ideas as to why.
Bill

RE: Form will not open

> I would be interested in anyone's ideas as to why.
My crystal ball is broken and I cannot see your code in ONCURRENT event. So my guess is - you have an error on line 17

Have fun.

---- Andy

There is a great need for a sarcasm font.

RE: Form will not open

Some form of corruption would be my guess!

I did notice something that I'm sure is unrelated to the problem, but you need to be made aware of, as it could cause other problems down the line. When you do something like this

CODE -->

Dim i, ix, j, k, L, m, n, p, q, r As Currency 

I suspect that you think that you're dimming

i, ix, j, k, L, m, n, p, q and r

as Currency, but in fact, you're only dimming the Variable named r as Currency!

i, ix, j, k, L, m, n, p and q

are being dimmed as Variants! You have to explicitly Dim each Variable's Type or the Access Gnomes assume that it is a Variant.

Just thought you should know!

Hope this helps!

There's always more than one way to skin a cat!

All posts/responses based on Access 2003/2007

RE: Form will not open

(OP)
Thank you that is good to know. I assume that also applies to the other dim statements; (Dim dt, Cdt as Date)Only Cdt is the only one set as a date?

RE: Form will not open

Dim dt, Cdt as Date - yes, only Cdt is a Date, dt is a Variant.
You should either do:
Dim dt As Date, Cdt as Date
or (better in my opinion)
Dim dt As date,
Dim Cdt as Date

Have fun.

---- Andy

There is a great need for a sarcasm font.

RE: Form will not open

I would also recommend to compact and repair your database. Make sure to make a backup first. Also in the vbe make sure to select "Debug" then "compile"

RE: Form will not open

On the back of MajP - I would recommend that you import EVERYTHING into a new database, then follow MajP's directions.
This ensures that all 'loose' references are removed completely.

D

RE: Form will not open

(OP)
Thanks for all your help
Bill

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close