Form Coding Assistance Please?

G

Golfinray

I have this code on an onclick event of a command button to open a form:
Private Sub Command0_Click()
Dim stPassword As String
stPassword = inputbox("Enter Your Password")
If stPassword = "areaa" Then
DoCmd.OpenForm "manager a tracking", , , acnornmal
Else: MsgBox "You Entered the wrong password"
End If
End Sub

I would like to add to that a command(s) to close the little menu form that
contains the command buttons when the manager a tracking form opens then
reopen it at close. I know it has to be something like me.visible = false
and me.visible = true. but I'm not quite sure where to put those. Also is
acnormal the correct command to allow the managers to edit their tracking
forms and save on exit?
 
R

ruralguy via AccessMonster.com

Try this code instead:
Private Sub Command0_Click()
Dim stPassword As String
stPassword = InputBox("Enter Your Password")
If stPassword = "areaa" Then
Me.Visible = False
DoCmd.OpenForm "manager a tracking", , , , , acDialog
Me.Visible = True
Else
MsgBox "You Entered the wrong password"
End If
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top