|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
|
|
#1
|
|||
|
|||
|
Comparing Two Values
If Form_Prospects_Restrictions.Value > Communication_Number.Value Then
MsgBox "Restricted" Else Communication_Date.Value = Format(Now, "mm dd yy") End If the 2 values i am comparing are from different forms. one a parent form (prospects) and one a subform (communication). i am getting the error message "object required". how can i make the form (communication) recognize the restrictions field from the prospects form? is this the problem? thanks. ameen |
|
#2
|
|||
|
|||
|
try this:
if your are referring to a control on a form i believe you need to call it as in MyForm.MyControl.Value if its a text box i think it should be MyForm.MyControl.Text ....however you may have to set focus first on the relevant controls to get the value. dim val1 as String, val2 as String MyForm.MyControl.SetFocus val1 = MyForm.MyControl.Value MyForm.MyControl.SetFocus val2 = MyForm.MyControl.Value then do your comparison with val1 and val2. hope that helps....if thats what you were trying to accomplish. |
|
#3
|
|||
|
|||
|
sorry forgot to mention this:
If(val1 > val2) Then MsgBox "Restricted" Else ............ Relevant code here End If |
|
#4
|
|||
|
|||
|
thank you very much.
|
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > Visual Basic Programming > Comparing Two Values |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|