Connecting Tech Pros Worldwide Help | Site Map

If-else condition

  #1  
Old December 11th, 2006, 07:35 AM
kev
Guest
 
Posts: n/a
Hi folks,

I have a form(frmResultsDisplay) that displays the status of an
equipment. Based on the status whether "Pending" or "Approved", i want
to restrict the user. What i mean here is if the status is pending, i
want to restrict the user to continue to next level and if status is
approved i want the user to proceed to next level meaning open form
"frmSafetyLevel2"

How do i achive this? I am pretty sure there is coding to it. So pls
give me a complete coding plus where to attach it to (which event)

Thanks a lot.:)

  #2  
Old December 11th, 2006, 09:15 AM
Keith Wilby
Guest
 
Posts: n/a

re: If-else condition


"kev" <kevi.mel@gmail.comwrote in message
news:1165823703.616844.174900@73g2000cwn.googlegro ups.com...
Quote:
Hi folks,
>
I have a form(frmResultsDisplay) that displays the status of an
equipment. Based on the status whether "Pending" or "Approved", i want
to restrict the user. What i mean here is if the status is pending, i
want to restrict the user to continue to next level and if status is
approved i want the user to proceed to next level meaning open form
"frmSafetyLevel2"
>
How do i achive this? I am pretty sure there is coding to it. So pls
give me a complete coding plus where to attach it to (which event)
>
Thanks a lot.:)
>
I think the easiest method might be to disable the button that opens
"frmSafetyLevel2" where status is "Pending". You can do this in your form's
Current event. Assuming that status is controlled via a combo box call
cboStatus:

If Me.cboStatus = "Pending" Then
Me.cmdMyCommandButton.Enabled = False
Else
Me.cmdMyCommandButton.Enabled = True
End If

HTH - Keith.
www.keithwilby.com


  #3  
Old December 11th, 2006, 09:35 AM
kev
Guest
 
Posts: n/a

re: If-else condition


Hi Keith,

Thanks a lot. It worked perfectly fine.

Keith Wilby wrote:
Quote:
"kev" <kevi.mel@gmail.comwrote in message
news:1165823703.616844.174900@73g2000cwn.googlegro ups.com...
Quote:
Hi folks,

I have a form(frmResultsDisplay) that displays the status of an
equipment. Based on the status whether "Pending" or "Approved", i want
to restrict the user. What i mean here is if the status is pending, i
want to restrict the user to continue to next level and if status is
approved i want the user to proceed to next level meaning open form
"frmSafetyLevel2"

How do i achive this? I am pretty sure there is coding to it. So pls
give me a complete coding plus where to attach it to (which event)

Thanks a lot.:)
>
I think the easiest method might be to disable the button that opens
"frmSafetyLevel2" where status is "Pending". You can do this in your form's
Current event. Assuming that status is controlled via a combo box call
cboStatus:
>
If Me.cboStatus = "Pending" Then
Me.cmdMyCommandButton.Enabled = False
Else
Me.cmdMyCommandButton.Enabled = True
End If
>
HTH - Keith.
www.keithwilby.com
Closed Thread


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to read confusing execution code under IF condition new2c answers 2 November 10th, 2008 08:45 PM
if condition in asp charmgirl answers 6 October 31st, 2007 05:11 PM
insert into temp table based on if condition das answers 5 April 12th, 2006 09:35 PM
onClcik with IF Condition RA answers 4 November 18th, 2005 10:01 PM
A simple IF condition. Alec answers 4 September 2nd, 2005 02:15 PM