Solved

InputMsg Format

Posted on 2004-09-26
13
237 Views
Last Modified: 2008-02-01
Hi there
i locked all items in the form to dont allowe any user to change
its values . but once dblclick the item , user have to define his password , if it is correct , user could change teh data ,
i know this may need security table to define users and there passwords . but i dont need all of that , only this form disallowed
to changed , i need only simple way to send an inputbox to the user to type his password ,
but could i change datatformat to the input box to be as a password format ? or i have to make a simple form for it ?
0
Comment
Question by:rudwan
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 3
  • 2
  • +2
13 Comments
 
LVL 12

Expert Comment

by:Sayedaziz
ID: 12155656
u can use popup form for password
0
 
LVL 27

Expert Comment

by:jjafferr
ID: 12155670
Hi rudwan,

Like Sayedaziz said, you can do a simple Form for that,
OR
you can use the old boring looking Inputbox.

I hope this helps,

jaffer
0
 

Author Comment

by:rudwan
ID: 12155682
it is ok jjafer , but just i want to ask wether i can change the format of
inputbox or not ?

0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 66

Expert Comment

by:Jim Horn
ID: 12155795
Try something like this....

Private Sub YourButtonName()
Call password_prompt
End Sub

(repeat the above for all control's .DblClick events)

Private Sub password_prompt

dim sPassword as string, ctl as Control

sPassword = InputBox("Enter the password here")

if sPassword = "WhateverYourPassword is" then
    dim ctl as controls
    For Each ctl in me.Controls
      If TypeOf ctl <> "Label" then
        ctl.Locked = False
        ctl.Enabled = True
      end if
    Next
    Me.Refresh
else
    msgbox "Password was incorrect."
end if

End Sub
0
 
LVL 41

Expert Comment

by:shanesuebsahakarn
ID: 12155971
> input box to be as a password format

No, you can't:
http://www.mvps.org/access/general/gen0020.htm
0
 

Author Comment

by:rudwan
ID: 12157772
hi jimborn
thank  u alot for that code , but it is already excit in my form , my question was weather i could format inputbox mask or not
i am so sorry , i have to accept shanesuebanakarn commet
but look  shanesuebanakarn , i will make a simple popup form
has password input mask , but after calling it and type password ,
for example :
form!password!passwordText="MyPassword"
how do i can evaluate it through the first form ? shall i have to use
an argument ?
0
 
LVL 12

Assisted Solution

by:Sayedaziz
Sayedaziz earned 100 total points
ID: 12161362
check with the following code required to be put in each Form_Open event which needs password verification :

Private Sub Form_Open(Cancel As Integer)
 DoCmd.OpenForm "password", acNormal, , , acFormEdit, acDialog
 Forms!password.passwordText.SetFocus
 
 If Forms!password.passwordText = "AZIZ" Then
   Forms!password.passwordText = Null
   DoCmd.Close acForm, "password", acSaveNo
 Else
   MsgBox "Incorrect Password ... Editing Not Allowed", vbOKOnly
   DoCmd.CancelEvent
 End If
 
End Sub
0
 
LVL 12

Expert Comment

by:Sayedaziz
ID: 12161482
The following attributes of the password form also need to be changed as follows :

Pop Up       -    Yes

Border Style   -  Dialog

Control Box  - No

Min Max Buttons - None

Close Button - No

Allow Design Change - Design View Only

Moveable   -  No
0
 

Author Comment

by:rudwan
ID: 12162420
hi sayyed
it is good idea , i tried it , but faced a problem that when form!password opend , it needs eighter to close or minimize ,
if closed , then passwordtext will be unknown , if minimized , then
it still the effective form
it needs additional code to continue work
0
 
LVL 27

Expert Comment

by:jjafferr
ID: 12163751
rudwan
why do you need the password later?
Once the Form checks and confirmsthe password is correct, then you longer need it.

If you need the password for another Form, then this is what you should do:

 If Forms!password.passwordText = "AZIZ" Then
   DoCmd.OpenForm "Form2", acNormal
   Forms![Form2]![Form2Password]=Forms![Password]![PasswordText]
   Forms!password.passwordText = Null
   DoCmd.Close acForm, "password", acSaveNo
...


jaffer
0
 
LVL 41

Accepted Solution

by:
shanesuebsahakarn earned 25 total points
ID: 12166485
Using Sayedaziz's code, you need to set the password form's Visible property to False instead of closing it when the user clicks on the "Close" button on the password form. You should also place the DoCmd.Close line in the Else part of the statement as well.
0
 
LVL 12

Expert Comment

by:Sayedaziz
ID: 12172491
I forget to tell you to put a command button (Proceed) on password form and in the click event of the Proceed command button use the following code :

Private Sub Proceed_Click()
 Me.Visible = False
End Sub
0
 
LVL 12

Expert Comment

by:Sayedaziz
ID: 12172541
and don't allow user to minimize/ close the password form .... he will be left with only option to click proceed button. for this i have told u in my previous post to set the password form property as follows :

Pop Up       -    Yes

Border Style   -  Dialog

Control Box  - No

Min Max Buttons - None

Close Button - No

Allow Design Change - Design View Only

Moveable   -  No
0

Featured Post

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question