Solved

InputMsg Format

Posted on 2004-09-26
13
219 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
  • 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
 
LVL 65

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
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 
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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

This article is a continuation or rather an extension from Cascading Combos (http://www.experts-exchange.com/A_5949.html) and builds on examples developed in detail there. It should be understandable alone, but I recommend reading the previous artic…
When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.

706 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now