Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

InputMsg Format

Posted on 2004-09-26
13
Medium Priority
?
252 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
Veeam Task Manager for Hyper-V

Task Manager for Hyper-V provides critical information that allows you to monitor Hyper-V performance by displaying real-time views of CPU and memory at the individual VM-level, so you can quickly identify which VMs are using host resources.

 
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

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

Question has a verified solution.

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

In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

618 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