S
Steven V. Olson
The following code is used in a click event for a command
button located on a form called "Clear Lens Or Segment
Styles Form". This form is linked to another form
called "Patient Safety Rx Order Form" by the common
field "Rx#". Both Forms utilize the same table Rx Orders
Table. As I share the code I will explain how it
functions, what works and what doesn't work. The code is
as follows:
Private Sub Command45_Click()
On Error GoTo Err_Command45_Click
LensOrSegmentStyles = "S.V. Clear Glass."
'This code enters the value into a text box on the
Patient Safety Rx Order Form, and it is working fine.
Tint = "Clear."
'This code enters the value into another text box on
the Patient Safety Rx Order Form, and it is working fine.
Material = 2
'This code enters a value into an option box field on
the Patient Safety Rx Order Form, and it is working fine.
HardeningProcess = 1
'This code should enter a different value into
another Option box field on the Patient Safety Rx Order
Form, however this value does not get entered. When I
place another command button directly on the "Patient
Safety Rx Order Form" The code " Hardening Process = 1 "
works just fine. I don't understand why the code works for
the Material = 2 entry, but it won't work for the
HardeningProcess = 1 entry. What gives?
DoCmd.Close
'This command closes the Clear Lens Or Segment Styles
Form, and it works just fine.
DoCmd.DoMenuItem acFormBar, acRecordsMenu, 5, ,
acMenuVer70
'This command refreshes the screen and it is working
fine.
Exit_Command45_Click:
Exit Sub
Err_Command45_Click:
MsgBox Err.Description
Resume Exit_Command45_Click
End Sub
Please send replies to (e-mail address removed)
Sincerely,
Steve Olson
button located on a form called "Clear Lens Or Segment
Styles Form". This form is linked to another form
called "Patient Safety Rx Order Form" by the common
field "Rx#". Both Forms utilize the same table Rx Orders
Table. As I share the code I will explain how it
functions, what works and what doesn't work. The code is
as follows:
Private Sub Command45_Click()
On Error GoTo Err_Command45_Click
LensOrSegmentStyles = "S.V. Clear Glass."
'This code enters the value into a text box on the
Patient Safety Rx Order Form, and it is working fine.
Tint = "Clear."
'This code enters the value into another text box on
the Patient Safety Rx Order Form, and it is working fine.
Material = 2
'This code enters a value into an option box field on
the Patient Safety Rx Order Form, and it is working fine.
HardeningProcess = 1
'This code should enter a different value into
another Option box field on the Patient Safety Rx Order
Form, however this value does not get entered. When I
place another command button directly on the "Patient
Safety Rx Order Form" The code " Hardening Process = 1 "
works just fine. I don't understand why the code works for
the Material = 2 entry, but it won't work for the
HardeningProcess = 1 entry. What gives?
DoCmd.Close
'This command closes the Clear Lens Or Segment Styles
Form, and it works just fine.
DoCmd.DoMenuItem acFormBar, acRecordsMenu, 5, ,
acMenuVer70
'This command refreshes the screen and it is working
fine.
Exit_Command45_Click:
Exit Sub
Err_Command45_Click:
MsgBox Err.Description
Resume Exit_Command45_Click
End Sub
Please send replies to (e-mail address removed)
Sincerely,
Steve Olson