Where Are the Forms

D

DS

I Have this sample code...and it works great. I want to change the
forms that pop-up. Where are the forms located within this code. I
want to replace the input dox as well as the error message. Any help
would be appreciated. Thank You.
DS


Private Sub Label18_DblClick(Cancel As Integer)
'Attached to On Click event of cmdOpenBackofficeForm

Dim strPasswd

strPasswd = InputBox("Enter Password", "Restricted Form")

'Check to see if there is any entry made to input box, or if
'cancel button is pressed. If no entry made then exit sub.

If strPasswd = "" Or strPasswd = Empty Then
MsgBox "No Input Provided", vbInformation, "Required Data"
Exit Sub
End If

'If correct password is entered open Backoffice form
'If incorrect password entered give message and exit sub

If strPasswd = "Candy" Then
DoCmd.OpenForm "Backoffice", acNormal
Else
MsgBox "Sorry, you do not have access to this form", vbOKOnly,
"Important Information"
Exit Sub
End If
End Sub
 
D

Dirk Goldgar

DS said:
I Have this sample code...and it works great. I want to change the
forms that pop-up. Where are the forms located within this code. I
want to replace the input dox as well as the error message. Any help
would be appreciated. Thank You.
DS


Private Sub Label18_DblClick(Cancel As Integer)
'Attached to On Click event of cmdOpenBackofficeForm

Dim strPasswd

strPasswd = InputBox("Enter Password", "Restricted Form")

'Check to see if there is any entry made to input box, or if
'cancel button is pressed. If no entry made then exit sub.

If strPasswd = "" Or strPasswd = Empty Then
MsgBox "No Input Provided", vbInformation, "Required Data"
Exit Sub
End If

'If correct password is entered open Backoffice form
'If incorrect password entered give message and exit sub

If strPasswd = "Candy" Then
DoCmd.OpenForm "Backoffice", acNormal
Else
MsgBox "Sorry, you do not have access to this form", vbOKOnly,
"Important Information"
Exit Sub
End If
End Sub

InputBox() is a built-in function. You can change the prompt and the
title of the dialog box it displays, but you can't supply your own form
without replacing the whole function with your own code.

The messages are displayed by another built-in function, MsgBox(). You
can change the message, the dialog caption, and a few other small
features, but again you can't supply your own form for the dialog
without replacing the function call with your own code.

It is possible to write your own functions to replace these, and supply
your own forms for them, but it may be more elaborate than you had in
mind. What exactly is it that you want to do?
 

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