473,385 Members | 1,564 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

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
Nov 13 '05 #1
2 1031
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Jim Heavey | last post by:
I am transitioning from Vb.Net to C#. When using VS.Net with VB.Net while working in the code window, you can use a drop down list of all of the objects/contrl on the form, and then once you...
1
by: Christoph Boget | last post by:
Where can I find *comprehensive* information about events? I've been all through Microsofts developer pages, through the VS.NET help but I can't find comprehensive, details information about them....
2
by: gramps | last post by:
Hi, using VB.Net in VS IDE, when a text box is declared 'WithEvents' this makes it available in the 'Class Name' drop down of the code window. If selected, the textbox's events are then...
5
by: Paal Berggreen | last post by:
I am involved with development of a Portal solution using ASP.NET 2.0 and WebParts. The WebParts framework use the default personalization providers, and the personalization data thus ends up in...
7
by: sam.m.gardiner | last post by:
I'm working with VB.NET events and I want a way to disconnect all the handlers of an event. I want to do this in the object that is the source of the event. This is slightly tricky in VB.Net as the...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.