Lost Focus.. basic confusion

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • md100
    New Member
    • Mar 2007
    • 5

    Lost Focus.. basic confusion

    Basically im an amature at this stuff as ive just started, and teacher thinks we are all young Bill Gates.

    I have a main form of Examiner Details and a subform with other details. I want 1 thing in the subform to be the same as in the main form, if not displaying a message. So im not sure how to set this out... I gave this a go

    Private Sub ScriptID_LostFo cus()

    'ScriptID must equal SubRefcode2'
    If ([ScriptID] <> [SubRefCode2]) Then
    MsgBox "Script ID wrong"

    End If
    End Sub

    ---------------
    But nothing happens.... do i need to state the location of the fields, if so could you please post how i will succeed in doing this..
    Thankyou
  • balid
    New Member
    • Feb 2007
    • 18

    #2
    Originally posted by md100
    Basically im an amature at this stuff as ive just started, and teacher thinks we are all young Bill Gates.

    I have a main form of Examiner Details and a subform with other details. I want 1 thing in the subform to be the same as in the main form, if not displaying a message. So im not sure how to set this out... I gave this a go

    Private Sub ScriptID_LostFo cus()

    'ScriptID must equal SubRefcode2'
    If ([ScriptID] <> [SubRefCode2]) Then
    MsgBox "Script ID wrong"

    End If
    End Sub

    ---------------
    But nothing happens.... do i need to state the location of the fields, if so could you please post how i will succeed in doing this..
    Thankyou
    If SubRefcode2 is not on the same form as ScriptID then you will need to reference the form it is on. How are you storing the values on your subform? Are you using a listbox or an array?

    Comment

    • ansumansahu
      New Member
      • Mar 2007
      • 149

      #3
      Originally posted by md100
      Basically im an amature at this stuff as ive just started, and teacher thinks we are all young Bill Gates.

      I have a main form of Examiner Details and a subform with other details. I want 1 thing in the subform to be the same as in the main form, if not displaying a message. So im not sure how to set this out... I gave this a go

      Private Sub ScriptID_LostFo cus()

      'ScriptID must equal SubRefcode2'
      If ([ScriptID] <> [SubRefCode2]) Then
      MsgBox "Script ID wrong"

      End If
      End Sub

      ---------------
      But nothing happens.... do i need to state the location of the fields, if so could you please post how i will succeed in doing this..
      Thankyou

      How are you calling this sub ScriptID_LostFo cus(). Is it called on some event or just when the subform loads up??

      thanks
      ansuman sahu

      Comment

      Working...