B
Bill
In the code below, I've attempted to check a
value entered by the user and restore the
original value if what was entered exceeds
the maximum for the current application. So
far, I've been unsuccessful in restoring what
was saved at open time. Saving of the
restored value (Me.ImageRatio = Ratio) using
Me.Requery after the assignment statement
gives a runtime error related to macro or
function validation rule for the field. I have
not set a validation rule in the property sheet
for the control.
What am I missing here?
Bill
======(Application)====================
Option Compare Database
Dim strRatio As String
______________________________________
Private Sub Form_Open(Cancel As Integer)
Ratio = Me.ImageRatio 'Save current value
End Sub
_______________________________________
Private Sub tbImageRatio_BeforeUpdate(Cancel As Integer)
If Me.ImageRatio > 1.34 Then 'Notify user and restore original value.
MsgBox "The image ratio you entered [" & Me.tbImageRatio & "]
exceeds the " & vbNewLine & _
"maximum value of 1.34. Please adjust the " & vbNewLine & _
"aspect ratio of your images to 1.34 or less."
Me.ImageRatio = strRatio
End If
End Sub
=====================================
value entered by the user and restore the
original value if what was entered exceeds
the maximum for the current application. So
far, I've been unsuccessful in restoring what
was saved at open time. Saving of the
restored value (Me.ImageRatio = Ratio) using
Me.Requery after the assignment statement
gives a runtime error related to macro or
function validation rule for the field. I have
not set a validation rule in the property sheet
for the control.
What am I missing here?
Bill
======(Application)====================
Option Compare Database
Dim strRatio As String
______________________________________
Private Sub Form_Open(Cancel As Integer)
Ratio = Me.ImageRatio 'Save current value
End Sub
_______________________________________
Private Sub tbImageRatio_BeforeUpdate(Cancel As Integer)
If Me.ImageRatio > 1.34 Then 'Notify user and restore original value.
MsgBox "The image ratio you entered [" & Me.tbImageRatio & "]
exceeds the " & vbNewLine & _
"maximum value of 1.34. Please adjust the " & vbNewLine & _
"aspect ratio of your images to 1.34 or less."
Me.ImageRatio = strRatio
End If
End Sub
=====================================