Results 1 to 9 of 9
  1. #1
    survivo01 is offline Advanced Beginner
    Windows XP Access 2010 32bit
    Join Date
    Jun 2011
    Posts
    71

    Selecting record in subform

    I have a form with two subforms and one subform has a subform. I want the subform of the subform to go to the new record
    Last edited by survivo01; 10-28-2012 at 01:28 PM.

  2. #2
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows XP Access 2003
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,610
    Perhaps the following line of code in the sub forms On Open event is what you need:

    DoCmd.GoToRecord , , acLast
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  3. #3
    survivo01 is offline Advanced Beginner
    Windows XP Access 2010 32bit
    Join Date
    Jun 2011
    Posts
    71
    This may sound dumb! I do not know where you find "open event". I would think this command goes some where on the property sheet. I have 2010. C orrection I now think you mean the event tab on the property sheet. Where I go wrong is which form to place the event. Also, what each event does. Is there definitions somewhere for each event. Orignally, I meant to say new record not last record. However, actually I don't want any record selected. I have several feilds in my form that are true false. The true fields are formatted a different color. However, when the select record feature highlights a row in my form data heet it washes out the colors in my true fields on the row that is selected. I was able to make the data sheet form select new record on the form. However, when I make it a subform I will get messages cannot do command because form is not open.
    Last edited by survivo01; 10-28-2012 at 02:01 PM. Reason: confusing question

  4. #4
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows XP Access 2003
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,610
    You may find this link about links will be of help: http://office.microsoft.com/en-us/ac...005186761.aspx

    To go to a new record use:
    DoCmd.GoToRecord , , acNewRec

    My suggestion was to use it in the On Open event of whichever form it is that you wanted to display a new record in.
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  5. #5
    survivo01 is offline Advanced Beginner
    Windows XP Access 2010 32bit
    Join Date
    Jun 2011
    Posts
    71
    Thanks
    I can now get it to do the action in the form.
    but I have the form enroll inmate
    subform class schedule
    subform inmates not enrolled
    subform inmate schedule.

  6. #6
    survivo01 is offline Advanced Beginner
    Windows XP Access 2010 32bit
    Join Date
    Jun 2011
    Posts
    71
    Thanks
    I can now get it to do the action in the form. but it will not wrok when I make this form a subform
    I have the form enroll inmate
    subform class schedule
    subform inmates not enrolled
    subform inmate schedule. (subform of subform inmates not enrolled) It will not go to new record here

  7. #7
    survivo01 is offline Advanced Beginner
    Windows XP Access 2010 32bit
    Join Date
    Jun 2011
    Posts
    71
    Thanks
    I can now get it to do the action in the form. but it will not wrok when I make this form a subform
    I have the form enroll inmate
    subform class schedule
    subform inmates not enrolled
    subform inmate schedule. (subform of subform inmates not enrolled) It will not go to new record here

  8. #8
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows XP Access 2003
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,610
    ...but it will not work...
    Can you give us any more detail. Have you checked that the code is fired? Do you get an error message?
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  9. #9
    survivo01 is offline Advanced Beginner
    Windows XP Access 2010 32bit
    Join Date
    Jun 2011
    Posts
    71
    I receive no error message I don't know how to check and see if code fired. Will try to learn about that now.

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

Similar Threads

  1. Replies: 6
    Last Post: 08-22-2012, 03:24 AM
  2. Selecting a Record in Datasheet view
    By JFo in forum Access
    Replies: 3
    Last Post: 11-01-2011, 10:10 PM
  3. Replies: 9
    Last Post: 09-16-2011, 03:52 PM
  4. Record Selecting
    By dbprogman in forum Programming
    Replies: 5
    Last Post: 04-27-2011, 10:35 PM
  5. Help with Selecting a single record in access.
    By rfhall50 in forum Programming
    Replies: 3
    Last Post: 08-10-2009, 08:50 AM

Tags for this Thread

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