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!

Using Access with SQl Server system stored procedures

Status
Not open for further replies.

jcfrasco

IS-IT--Management
Apr 27, 2001
89
US
I've created a stored procedure using a SELECT statement and I used the @user to get the current user. I'm using the stored procedure as the control source for a form and I want to lock certain fields based on who the user is. I set a text box control source equal to the user and now I want to use VBA to program my form with If...Else statements. I can make a MsgBox indicate the user, but no matter what I try I can't get an If statement, (exp: If Me!User.value = "sdial" Then), to equal the condition. And I know that it is "sdial"! What seems to be my error and are there any better ways at doing this?
 
Terry,

I plan on using it during form Open. Once the form opens and the fields are locked or unlocked, they won't need to change. If you need any additional information I'll respond as soon as I receive the e-mail notification.

Thank you,
jcfrasco
 
I'm trying to duplicate the problem but can't seem to do so. The If... Then... Else works well. I've tried it in Form Open, Activate, and On Current events without error.

Could you be so kind as to post the code, including the Stored Proc?

Thanks, Terry

;-) He has the right to criticize who has the heart to help. -Abraham Lincoln

SQL Article links:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top