Error 2017: VB Project Password Help Needed: (1 Viewer)

gold007eye

Registered User.
Local time
Yesterday, 23:41
Joined
May 11, 2005
Messages
260
I have a password set on the VB coding to prevent people from viewing the code. This has been working great until I try to use the code below:

Code:
    DoCmd.SetWarnings False
    DoCmd.DeleteObject acTable, "DateFlagged"
    DoCmd.OpenQuery "Clear License"
[COLOR="Red"]    DoCmd.Rename "Logon-D", acForm, "Logon"
    DoCmd.Rename "Logon", acForm, "Logon-R"[/COLOR]
    DoCmd.SetWarnings True
    DoCmd.Close acForm, "Register", acSaveNo
    DoCmd.OpenForm "Logon"

The red text seems to be where I am getting the error.

2017: "Microsoft helps protect this Visual Basic for Applications Project with a password. You must supply the password in tehe Visual Basic Editor before you cab perform this operation".

Is there a way I can bypass this and still have it rename the forms. Or is there a way I can somehow turn off the password... run the renaming code... and then turn the password back on? I have been racking my brain and sifting through searches, but haven't found anything like this.

-Jay
 

ajetrumpet

Banned
Local time
Yesterday, 22:41
Joined
Jun 22, 2007
Messages
5,638
3 questions here:

1) why rename forms in VB?
2) how did you PW protect the code? I've never done it in Access. Just excel (I'm curious)
3) why not give users a runtime version?
 

gold007eye

Registered User.
Local time
Yesterday, 23:41
Joined
May 11, 2005
Messages
260
3 questions here:

1) why rename forms in VB?
2) how did you PW protect the code? I've never done it in Access. Just excel (I'm curious)
3) why not give users a runtime version?

1) I'm using to different versions of a specific form. 1 for Registered users and 1 for Demo purposes
2) If you go into the Visual Basic view.
  • Go to Tools
  • Database Properties
  • Click on the Protection tab
  • Click Lock for viewing
  • Enter the password you want in both fields
Once you have done this if you try to view any of the code a password will popup before you can view the code.

3) In the end that is my goal to give a run-time version, but I haven't done that before so I'm not sure where to start.

When using a runtime version is it possible to rename forms, delete them, etc.?
 
Last edited:

ajetrumpet

Banned
Local time
Yesterday, 22:41
Joined
Jun 22, 2007
Messages
5,638
I must admit that I asked a stupid question here. I've locked the stuff in Excel before, so that was dumb to ask. :D

Anyway, i have no answer here, but i would take out one of the forms out. that's my suggestion
 

Users who are viewing this thread

Top Bottom