Results 1 to 4 of 4
  1. #1
    Star Lounger
    Join Date
    Sep 2003
    Posts
    52
    Thanks
    0
    Thanked 0 Times in 0 Posts

    fields don't change with dropdown (acces 2003)

    Hello all,
    we have a problem with our acces database for school....
    whe have made a dropdown menu in a view forms (wijzigen les, leerling, oordeel, opleiding) but when we select something the other fields don't change...
    I have put the tabels en form from wijzigen leerling in the database db1 for example.
    http://aa.1asphost.com/gerwin/db1.mdb (it's to big...)

    GERWIN

  2. #2
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: fields don't change with dropdown (acces 2003)

    Do you mean that you want to find a Leerling when you use the combo (Keuzelijst) Leerlingnummer ?
    If so, you have to put some code in the after update event of the combo:
    <pre>Private Sub Keuzelijst_met_invoervak29_AfterUpdate()
    Me.RecordsetClone.FindFirst "[leerlingnummer] = " & Me.Keuzelijst_met_invoervak29
    Me.Bookmark = Me.RecordsetClone.Bookmark
    End Sub</pre>

    Francois

  3. #3
    Star Lounger
    Join Date
    Sep 2003
    Posts
    52
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: fields don't change with dropdown (acces 2003)

    Tnx it works but not for all...
    2 forms won't work, we get debug errors (13)
    http://aa.1asphost.com/gerwin/db1.mdb

    Gerwin

  4. #4
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: fields don't change with dropdown (acces 2003)

    In the two forms, the searched data is of the type Text. When it is text you have to surround the criteria by quotes.
    For the form Wijzigen Oordeel use the following code :<pre>Private Sub Keuzelijst_met_invoervak4_AfterUpdate()
    ' De record zoeken die overeenkomt met het besturingselement
    Dim rs As Object
    Set rs = Me.Recordset.Clone
    rs.FindFirst "[Oordeel code] = '" & Me![Keuzelijst met invoervak4] & "'"
    If Not rs.EOF Then Me.Bookmark = rs.Bookmark
    End Sub</pre>

    For the form Wijzigen Opleiding use :<pre>Private Sub Type_Opleiding_AfterUpdate()
    ' De record zoeken die overeenkomt met het besturingselement
    Dim rs As Object
    Set rs = Me.Recordset.Clone
    rs.FindFirst "[Type Opleiding] = '" & Me.Type_Opleiding & "'"
    If Not rs.EOF Then Me.Bookmark = rs.Bookmark
    End Sub</pre>

    In the two piece of code you have, you also use a wrong field name to search.

    ps:If you want to attach a db, you can zip it. If you don't have Winzip, you can download it here
    Francois

Posting Permissions

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