G
gmazza via AccessMonster.com
Hey there,
I have a form that allows the user to enter a number in a field.
In the after update of the field, I have the following code:
Dim answer As Double
Dim answer1 As Double
answer = DLookup("Min", "CriteriaOption", "ClinicalTrialId = " &
GetActiveStudy() & " and SequenceNo = 2 ")
answer1 = DLookup("Max", "CriteriaOption", "ClinicalTrialId = " &
GetActiveStudy() & " and SequenceNo = 2 ")
If text1 >= answer And text1 <= answer1 Then
Else
MsgBox ("You must enter a number between " & answer & " and " & answer1)
text1 = ""
End If
After debugging and making sure everything was grabbing from the right place,
it was determined that Min was -2.3333 and Max was -9.7777.
When I enter a -6, it returns the MsgBox, when -6 is clearly between my min
and max.
Any ideas what I must be doing wrong?
My Min and Max datatypes are:
Field Size: Decimal
Format: General Number
Precision: 18
Scale: 4
Decimal Places: 4
I have a form that allows the user to enter a number in a field.
In the after update of the field, I have the following code:
Dim answer As Double
Dim answer1 As Double
answer = DLookup("Min", "CriteriaOption", "ClinicalTrialId = " &
GetActiveStudy() & " and SequenceNo = 2 ")
answer1 = DLookup("Max", "CriteriaOption", "ClinicalTrialId = " &
GetActiveStudy() & " and SequenceNo = 2 ")
If text1 >= answer And text1 <= answer1 Then
Else
MsgBox ("You must enter a number between " & answer & " and " & answer1)
text1 = ""
End If
After debugging and making sure everything was grabbing from the right place,
it was determined that Min was -2.3333 and Max was -9.7777.
When I enter a -6, it returns the MsgBox, when -6 is clearly between my min
and max.
Any ideas what I must be doing wrong?
My Min and Max datatypes are:
Field Size: Decimal
Format: General Number
Precision: 18
Scale: 4
Decimal Places: 4