Results 1 to 2 of 2
  1. #1
    3 Star Lounger
    Join Date
    Jul 2001
    Posts
    280
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Find student in another form (Access 2000)

    I have a form with rows for different diferent students,each row beginning with the studentid.
    I would like by clicking the control Studentid in the form1 to open the form2 and go
    exactly to this number in the form2.After that to go back again to the place in the form1
    This is in short what i want to do.Which is the best method?

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Find student in another form (Access 2000)

    I don't think it is a good idea to open another form when the user clicks in a field - it would be annoying if a form popped up if the user clicks in the field by accident. You could use the double click event, or provide a command button. For example:
    <code>
    Private Sub StudentID_DblClick(Cancel As Integer)
    DoCmd.OpenForm FormName:="Form2", WhereCondition:="StudentID = " & Me.StudentID
    End Sub
    </code>
    Replace Form2 with the name of the form. I have assumed that StudentID is a number field. If it is a text field, you must put Chr(34) (quotes) around the value:
    <code>
    ... WhereCondition:="StudentID = " & Chr(34) & Me.StudentID & Chr(34)</code>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •