?
Solved

InputMsg Format

Posted on 2004-09-26
13
Medium Priority
?
243 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
NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

 
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 300 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 75 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

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

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

If you need a simple but flexible process for maintaining an audit trail of who created, edited, or deleted data from a table, or multiple tables, and you can do all of your work from within a form, this simple Audit Log will work for you.
This article shows how to get a list of available printers for display in a drop-down list, and then to use the selected printer to print an Access report or a Word document filled with Access data, using different syntax as needed for working with …
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.
Suggested Courses

771 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