Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old November 13th, 2005, 12:10 AM
Kenny G
Guest
 
Posts: n/a
Default Events Assistance

Below is the code I currently have to either skip a control or go to a
control based on the response in the complications control. The
problem is even when Me.Complications is "None" the cursor goes to
RiskAssessment. What's wrong with my code?

Thanks in advance for your assistance.

Private Sub Complications_Exit(Cancel As Integer)
If Me.Complications = "None" Then
DoCmd.GoToControl "OrderRenewal"
Else
DoCmd.GoToControl "RiskAssessment"
MsgBox "Has A Risk Assessment Form Been Completed?",
vbInformation, "UHS"
Cancel = True
End If
End Sub

Below is a list that is used for the control:

tbl Complications
ComplicationsID(long integer) Complications (txtbox (FieldSize
25))
1 None
2 Skin Irritation
3 Skin Breakdown
4 Decreased Sensation
5 Motor Impariment

Control Source Complications
Row Source Type table/query
Row Source SELECT tblComplications.ComplicationsID,
tblComplications.Complications FROM tblComplications;
Bound Column 1

The only code in OrderRenewal is =PC() Proper Case in the afterupdate
event.



Kenny G
  #2  
Old November 13th, 2005, 12:10 AM
Salad
Guest
 
Posts: n/a
Default Re: Events Assistance

Kenny G wrote:
[color=blue]
> Below is the code I currently have to either skip a control or go to a
> control based on the response in the complications control. The
> problem is even when Me.Complications is "None" the cursor goes to
> RiskAssessment. What's wrong with my code?
>
> Thanks in advance for your assistance.
>
> Private Sub Complications_Exit(Cancel As Integer)
> If Me.Complications = "None" Then
> DoCmd.GoToControl "OrderRenewal"
> Else
> DoCmd.GoToControl "RiskAssessment"
> MsgBox "Has A Risk Assessment Form Been Completed?",
> vbInformation, "UHS"
> Cancel = True
> End If
> End Sub
>
> Below is a list that is used for the control:
>
> tbl Complications
> ComplicationsID(long integer) Complications (txtbox (FieldSize
> 25))
> 1 None
> 2 Skin Irritation
> 3 Skin Breakdown
> 4 Decreased Sensation
> 5 Motor Impariment
>
> Control Source Complications
> Row Source Type table/query
> Row Source SELECT tblComplications.ComplicationsID,
> tblComplications.Complications FROM tblComplications;
> Bound Column 1
>
> The only code in OrderRenewal is =PC() Proper Case in the afterupdate
> event.
>
>
>
> Kenny G[/color]

Yeah, change it to
If Me.Complications = "1"
or
If Me.Complications = 1
depending on the table value.

Hint: You can use Msgbox to assist in debugging. For example, you
could enter:
msgbox Me.Complications
as the first code line to see what the value is. When finished
debugging, remove the msgbox line.

I use msgbox to assist in debugging. Sometimes I expect a certain value
in a variable. Using msgbox, I sometimes find out my variable does not
contain the expected value. I then get down on my knees in supplication
and cry out "It's a miracle!" I've had so many miracles in my life my
workspace is a shrine visited by thousands of programmers. Many have
arrived on crutches and left as healthy idividuals.





  #3  
Old November 13th, 2005, 12:15 AM
Kenny G
Guest
 
Posts: n/a
Default Re: Events Assistance

That's it! Thanks! Yes, Yes, it is a miracle! Eureka! It's a Hoover.

Kenny G

Salad <oil@vinegar.com> wrote in message news:<G%Mtc.14808$be.2809@newsread2.news.pas.earth link.net>...[color=blue]
> Kenny G wrote:
>[color=green]
> > Below is the code I currently have to either skip a control or go to a
> > control based on the response in the complications control. The
> > problem is even when Me.Complications is "None" the cursor goes to
> > RiskAssessment. What's wrong with my code?
> >
> > Thanks in advance for your assistance.
> >
> > Private Sub Complications_Exit(Cancel As Integer)
> > If Me.Complications = "None" Then
> > DoCmd.GoToControl "OrderRenewal"
> > Else
> > DoCmd.GoToControl "RiskAssessment"
> > MsgBox "Has A Risk Assessment Form Been Completed?",
> > vbInformation, "UHS"
> > Cancel = True
> > End If
> > End Sub
> >
> > Below is a list that is used for the control:
> >
> > tbl Complications
> > ComplicationsID(long integer) Complications (txtbox (FieldSize
> > 25))
> > 1 None
> > 2 Skin Irritation
> > 3 Skin Breakdown
> > 4 Decreased Sensation
> > 5 Motor Impariment
> >
> > Control Source Complications
> > Row Source Type table/query
> > Row Source SELECT tblComplications.ComplicationsID,
> > tblComplications.Complications FROM tblComplications;
> > Bound Column 1
> >
> > The only code in OrderRenewal is =PC() Proper Case in the afterupdate
> > event.
> >
> >
> >
> > Kenny G[/color]
>
> Yeah, change it to
> If Me.Complications = "1"
> or
> If Me.Complications = 1
> depending on the table value.
>
> Hint: You can use Msgbox to assist in debugging. For example, you
> could enter:
> msgbox Me.Complications
> as the first code line to see what the value is. When finished
> debugging, remove the msgbox line.
>
> I use msgbox to assist in debugging. Sometimes I expect a certain value
> in a variable. Using msgbox, I sometimes find out my variable does not
> contain the expected value. I then get down on my knees in supplication
> and cry out "It's a miracle!" I've had so many miracles in my life my
> workspace is a shrine visited by thousands of programmers. Many have
> arrived on crutches and left as healthy idividuals.[/color]
 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles