Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old February 17th, 2003, 03:43 PM
bogglebeats bogglebeats is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2003
Posts: 24 bogglebeats User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 15 m 46 sec
Reputation Power: 0
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

Reply With Quote
  #2  
Old February 17th, 2003, 11:23 PM
Aaron77 Aaron77 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2002
Posts: 31 Aaron77 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 2 m 39 sec
Reputation Power: 11
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.

Reply With Quote
  #3  
Old February 17th, 2003, 11:26 PM
Aaron77 Aaron77 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2002
Posts: 31 Aaron77 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 2 m 39 sec
Reputation Power: 11
sorry forgot to mention this:

If(val1 > val2) Then
MsgBox "Restricted"
Else
............ Relevant code here

End If

Reply With Quote
  #4  
Old February 18th, 2003, 12:01 PM
bogglebeats bogglebeats is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2003
Posts: 24 bogglebeats User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 15 m 46 sec
Reputation Power: 0
thank you very much.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming > Comparing Two Values

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap