?
Solved

InputMsg Format

Posted on 2004-09-26
13
Medium Priority
?
255 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
Transaction-level recovery for Oracle database

Veeam Explore for Oracle delivers low RTOs and RPOs with agentless transaction log backup and transaction-level recovery of Oracle databases. You can restore the database to a precise point in time, even to a specific transaction.

 
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

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

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

Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
Windows Explorer lets you open cabinet (cab) files like any other folder. In VBA you can easily handle normal files and folders, but opening and indeed creating cabinet files takes a lot more - and that's you'll find here.
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…
Suggested Courses

850 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