Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Code Problems

Status
Not open for further replies.

Ielamrani

MIS
Jul 7, 2005
183
US
Hi,
I am trying this code but it's not working what Am I doing wrong?

if texUserName (in form named "frm1") then allow frmMain to be edited, else frmMain read only. Here is the code I used in frmMain (on Load):

Private Sub Form_Load()

If textUserName = "JSoifer" Then
Me.AllowEdits = True
else
Me.AllowEdits = False

Thanks in advance
Ismail
 
you refer to texUserName and later to textUserName
What's not working do you get an error?

“I sense many useless updates in you... Useless updates lead to defragmentation... Defragmentation leads to downtime...Downtime leads to suffering..Defragmentation is the path to the darkside.. DBCC INDEXDEFRAG and DBCC DBREINDEX are the force...May the force be with you" --
 
If jSoifer sign in she should be able to edit frmMain if anyone else sign in the frmMain should only be read they can't change or add etc.
the problem is the frmMain allows everyone to edit.
I hope this is clear.
Ismail
 
do a Messagebox on the username and verify that it is indeed JSoifer



“I sense many useless updates in you... Useless updates lead to defragmentation... Defragmentation leads to downtime...Downtime leads to suffering..Defragmentation is the path to the darkside.. DBCC INDEXDEFRAG and DBCC DBREINDEX are the force...May the force be with you" --
 
Now it's working. It was my fault(Spelling)
Thanks for your help
Ismail
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top