Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2010
    Posts
    2

    Very Novice User needs HELP with Form


    I am trying to create a form that finds the record when the student types in their id number, then populates the rest of the fields on the form with the information in the table. Additionally there needs to be a few fields that the student must complete the first time around since we don't have all the information.

  2. #2
    maximus's Avatar
    maximus is offline Expert
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Aug 2009
    Location
    India
    Posts
    931
    I have two tables tblStudent and tblForm

    I have a form whose record source is tblForm. There is an unbound textbox on the form in which the user has to type a StudentID after which clicking on the autofill button the Similar data from the tblStudent is pulled out and is used to populate the form:
    Code used in the Auto Fill Button:


    Dim intStudentID As Integer
    Dim strSQL As String

    If IsNull(Me.Text13) Then
    MsgBox "Please type an ID"
    Else

    intStudentID = Me.Text13
    strSQL = "Select * from tblStudent Where StudentID=" & Me.Text13

    Set rs = CurrentDb.OpenRecordset(strSQL)
    If rs.EOF And rs.BOF Then
    MsgBox "N Record for the ID typed"
    Exit Sub
    End If
    Me.StudentName = rs!StudentName
    Me.DOB = rs!DOB
    Me.GradeNo = rs!GradeNo
    rs.Close
    Set rs = Nothing
    Me.Text13 = Null
    End If


    pls refer to attached mdb file. (Type Number between 1 to 3 coz only three names are entered in the student table)

    if this solves your problem mark this thread solved.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Access Novice - Looking to learn from scratch.
    By Javaman in forum Database Design
    Replies: 1
    Last Post: 03-13-2010, 08:53 PM
  2. newbie-real NOVICE
    By SHCC in forum Database Design
    Replies: 1
    Last Post: 02-09-2010, 03:42 AM
  3. Help me i'm a novice!
    By andrew99 in forum Access
    Replies: 2
    Last Post: 12-30-2009, 10:19 AM
  4. Some advise for a complete novice...!
    By 450nick in forum Access
    Replies: 1
    Last Post: 09-11-2009, 02:23 AM
  5. Replies: 1
    Last Post: 02-27-2006, 07:46 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums