Results 1 to 5 of 5
  1. #1
    Join Date
    Feb 2005
    Location
    The Hague, Netherlands
    Posts
    95

    Unanswered: Showing 'current' record in txtboxes

    Hi, I have a db and I'm currently working on a nice, easy-to-use form. Unfortunately, I'm still pretty noob, and I have a question:

    I have made a subform where a table is shown (as an overview for the data in the db). As usual in Access, you can scroll through the data and a pointer shows at which record you are.

    Now, on another section of the form, I want to show the user the seperate data of the ACTIVE RECORD (not recordset or tbl or db) in neat textboxes. I want to make my own record-navigator, frankly. How do I do that? Is there a sort of 'current'-function that can read out the row I'm currently at in the table and assign this data to my txtboxes?

    Thx in advance

  2. #2
    Join Date
    Jan 2005
    Posts
    68
    you can set the parent form's current record from the subform by setting the parent form's recordsource. make sure your forms are not linked and put this code into your subform's on current event:

    dim strSQL as string
    strSQL = "[your forms recordsource] + WHERE [parent form id] = " & me!id & ";"
    me.parent.recordsource = strSQL

    hope this helps

  3. #3
    Join Date
    Feb 2005
    Location
    The Hague, Netherlands
    Posts
    95
    Quote Originally Posted by Frosty1
    you can set the parent form's current record from the subform by setting the parent form's recordsource. make sure your forms are not linked and put this code into your subform's on current event:

    dim strSQL as string
    strSQL = "[your forms recordsource] + WHERE [parent form id] = " & me!id & ";"
    me.parent.recordsource = strSQL

    hope this helps
    Thanks for the reply, I still need to learn some things :E
    I was hoping for some readout of CurrentRecord or smt, I found this exists but I cant seem to get it to work yet..
    I'll try this too

  4. #4
    Join Date
    Jan 2005
    Posts
    68
    if you just want to know the current record you can use:
    Me.CurrentRecord

    if you want to know the value of the current record by field you can use:
    me![field name]

    have fun playing around with these. there are many ways to do most things you want to do, and there is no best way.

  5. #5
    Join Date
    Feb 2005
    Location
    The Hague, Netherlands
    Posts
    95
    Quote Originally Posted by Frosty1
    have fun playing around with these. there are many ways to do most things you want to do, and there is no best way.
    I was afraid of that
    Thx

Posting Permissions

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