By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,285 Members | 1,691 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,285 IT Pros & Developers. It's quick & easy.

Events Assistance

P: n/a
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
Nov 13 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Kenny G wrote:
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


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.

Nov 13 '05 #2

P: n/a
That's it! Thanks! Yes, Yes, it is a miracle! Eureka! It's a Hoover.

Kenny G

Salad <oi*@vinegar.com> wrote in message news:<G%*****************@newsread2.news.pas.earth link.net>...
Kenny G wrote:
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


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.

Nov 13 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.