Using Forms as Navigation Panes - Buttons just stop working (1 Viewer)

samjh

Registered User.
Local time
Today, 01:33
Joined
Jan 10, 2013
Messages
64
Hi,

I have created Forms to use as navigation panes, and have inserted command buttons to go between the navigation panes or to open the forms for data input etc.

My main form is attached to Startup part of my database. Once I click on a button and it opens another form, I have a bit code in the button to make the form I was in not visible.

My problem is that when I go in and give it all a go, all of sudden none of the buttons work at all, and the only way to get out of the pane I am in is to click on the x at the top right hand side, where I am then out of the database. Its as if it gets stuck in a loop or something!

Should I be including somthing else in my code?

In all the control buttons I have the code looks like this, just referencing the relevant form.

Private Sub Command6_Click()
On Error GoTo Err_Command6_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Menu2MainMenu"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Forms![Menu1FrontScreen].Visible = False
Exit_Command6_Click:
Exit Sub
Err_Command6_Click:
MsgBox Err.Description
Resume Exit_Command6_Click

End Sub

Thanks.
 

jzwp22

Access Hobbyist
Local time
Yesterday, 20:33
Joined
Mar 15, 2008
Messages
2,629
I do not see a particular issue with the code itself. Is the database file stored in a trusted location as defined in Access (file-->options-->trust center--Trust center settings-->trusted locations)? If the database file is not in a defined trusted location, no code will execute. I think the trusted location part started in Access 2007.
 

samjh

Registered User.
Local time
Today, 01:33
Joined
Jan 10, 2013
Messages
64
Hi,

It has been built in Access 2003. It's still in build mode, in that in two weeks it will be split into a front end and back end, with the back end on a server and the front end as a short cut on users PC's. Currently it is sitting on my desk top. I just worry that this issue will continue after its gone live, so I wanted to check if there was something I had done wrong with the code.
 

jzwp22

Access Hobbyist
Local time
Yesterday, 20:33
Joined
Mar 15, 2008
Messages
2,629
I would check your security settings to make sure that running code is not restricted. Also, if you are doing a FE/BE, each user should put a copy of the FE file on their local harddrives.
 

Pat Hartman

Super Moderator
Staff member
Local time
Yesterday, 20:33
Joined
Feb 19, 2002
Messages
43,515
Compile the code and fix any compile errors.
 

samjh

Registered User.
Local time
Today, 01:33
Joined
Jan 10, 2013
Messages
64
Hi, thanks for your reply. Could you give me some pointers on how I would go about compiling the code please?
 

jzwp22

Access Hobbyist
Local time
Yesterday, 20:33
Joined
Mar 15, 2008
Messages
2,629
Go to the code window. Then select Debug-->compile.
 

samjh

Registered User.
Local time
Today, 01:33
Joined
Jan 10, 2013
Messages
64
Thank you.

However I thought I would mention that I have tested all the navigation panes, and discovered that when the the buttons stop working, if I right click my mouse that seems to fix the problem. I'm still not sure why this would be though.
 

jzwp22

Access Hobbyist
Local time
Yesterday, 20:33
Joined
Mar 15, 2008
Messages
2,629
Do you have any code that runs when you open the database?

I did find this thread. I'm not sure if would be applicable in your case.

In VBA, go to tools--> references and see if any are marked as "Missing" if so, you will need to resolve those


Have you run the compact/repair utility available in Access?

Other than that I am running out of ideas.
 

Users who are viewing this thread

Top Bottom