Results 1 to 4 of 4
  1. #1
    New Lounger
    Join Date
    Oct 2001
    Location
    Texas
    Posts
    20
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Fill in info in form based upon drop down box (Access 2000/Win 98)

    I know that you can create a drop down box for looking up specific information. Say I have a drop down box for Student ID (pulled from the student information table). How do I get Access to fill in the student names (from the student information table) based upon the student ID?
    I know that this seems pretty simple, but I can't get it to work. <img src=/S/please.gif border=0 alt=please width=31 height=23>

    Second question. If I have form for teach <img src=/S/cheers.gif border=0 alt=cheers width=30 height=16> er names (first and last names). How do I get combine the two different fields together to use on other forms/reports? <img src=/S/confused.gif border=0 alt=confused width=15 height=20>


    Thanks,
    Bookman21 <img src=/S/flags/Texas.gif border=0 alt=Texas width=30 height=18>

  2. #2
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: Fill in info in form based upon drop down box (Access 2000/Win 98)

    What table is the record source of the form containing the dropdown box?
    Is the form a Single Form or a Continuous form?
    If the form contains the student details you should be able to create the combobox using the wizard to read the appropriate record selected by the combobox.
    Pat <img src=/S/smile.gif border=0 alt=smile width=15 height=15>

  3. #3
    3 Star Lounger
    Join Date
    Oct 2001
    Location
    Newport, Gwent, Wales
    Posts
    257
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Fill in info in form based upon drop down box (Access 2000/Win 98)

    The first question, like patt says, if it's a single form the wizard will do this for you, the code behind it will look something like this: -

    Private Sub This_Particular_Combobox_AfterUpdate()
    ' Find the record that matches the control.
    Me.RecordsetClone.FindFirst "[quotenum] = " & Me![quotenum]
    Me.Bookmark = Me.RecordsetClone.Bookmark

    End Sub

    Where 'quotenum' is your reference.

    The second bit is concatenation, type the & sign into your help index, it has a reasonably good explanation, if not some one far more competent than me will be along before long to help you out.

    Ian

  4. #4
    Silver Lounger
    Join Date
    Jun 2002
    Location
    Cheadle, Staffordshire
    Posts
    2,177
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Fill in info in form based upon drop down box (Access 2000/Win 98)

    <P ID="edit" class=small>(Edited by D Willett on 17-Feb-03 13:15. )</P>To bring the two names together, first off.
    Do the first and lastnames relate to the forms recordsource, if so, create an unbound text and use the below as the control source.
    =[FirstName] & " , " & [LastName]

    You can auto fill your form using a combo wizard.
    "Find a record on my form .............." I think it's option 3 in the wizard.

    or

    If you have unbounds you can use:

    =NameOfCombo.Column(0)
    =NameOfCombo.Column(1)
    =NameOfCombo.Column(2)
    =NameOfCombo.Column(3)

    Combos columns start from 0 thru to how ever many columns you have.

    Hope this helps.

Posting Permissions

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