Results 1 to 11 of 11
  1. #1
    Middlemarch is offline Competent Performer
    Windows 10 Access 2019
    Join Date
    Mar 2015
    Posts
    365

    SubForm On Current event detect New

    In my datasheet subform I want to use the On Current event to choose an image to display.




    When the mainform moves to a new record, can the Subform know this is New - as opposed to a click on a subsequent record in the subform ?

  2. #2
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 10 Access 2016
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,543
    Quote Originally Posted by Middlemarch View Post
    In my datasheet subform I want to use the On Current event to choose an image to display.
    Is the image going to be on the Main form?

    Quote Originally Posted by Middlemarch View Post
    When the mainform moves to a new record, can the Subform know this is New - as opposed to a click on a subsequent record in the subform ?
    Know what is new?
    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
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,428

  4. #4
    Middlemarch is offline Competent Performer
    Windows 10 Access 2019
    Join Date
    Mar 2015
    Posts
    365
    Sonds good CJ but I can't make it work.
    In the SubForm Current event I put
    Code:
    MsgBox Me.Parent.NeWRecord
    but it shows 0 regardless of new record or not.

    Yes, Bob into an image control on the main form. (And the "what is new" is record.)

  5. #5
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,428
    think you need to show what you are trying to do.

    Are the subform linkchild/master properties populated?

    Since the 'event' that takes you to a new record is in the main form, the code needs to be in the main form

  6. #6
    Middlemarch is offline Competent Performer
    Windows 10 Access 2019
    Join Date
    Mar 2015
    Posts
    365
    Sorry, I don't know about subform linkchild/master or how to see if populated
    Yes, perhaps if I knew where the 'event' is I could set a global variable that the subForm current event could read.
    This could be when you the navigation bar? (Record selector??) button. Does that raise an event you can put code in ?

  7. #7
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,428
    Really not prepared to waste my time trying to guess what you have and what you are actually trying to achieve.

  8. #8
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 10 Access 2016
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,543
    Quote Originally Posted by Middlemarch View Post

    Yes, Bob into an image control on the main form. (And the "what is new" is record.)
    Well that much I realised, but a new record on which form: Main or Sub?
    The attached db may help with your understanding of the OnCurrent event.

    I agree with Chris that we can't be of much help i you don't give us much information. I would suggest that you tell us exactly what you are trying to do and post a copy of your db.
    Attached Files Attached Files
    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
    moke123's Avatar
    moke123 is offline Me.Dirty=True
    Windows 11 Office 365
    Join Date
    Oct 2012
    Location
    Ma.
    Posts
    1,654
    Sorry, I don't know about subform linkchild/master or how to see if populated
    Select the subform container and look in the property sheet.
    Click image for larger version. 

Name:	mc.png 
Views:	24 
Size:	9.5 KB 
ID:	50253
    If this helped, please click the star * at the bottom left and add to my reputation- Thanks

  10. #10
    Middlemarch is offline Competent Performer
    Windows 10 Access 2019
    Join Date
    Mar 2015
    Posts
    365
    Quote Originally Posted by CJ_London View Post
    Really not prepared to waste my time trying to guess what you have and what you are actually trying to achieve.
    If you can't understand my question then your replies are wasting my time too.

  11. #11
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,428
    not a problem for me -you are the one needing help and saved yourself time by not bothering to show what you are trying to. I'll put you on my ignore list, then everyone is happy

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

Similar Threads

  1. Detect Click in current row
    By Middlemarch in forum Forms
    Replies: 2
    Last Post: 04-24-2023, 08:12 PM
  2. Replies: 3
    Last Post: 12-23-2016, 08:39 PM
  3. On Current Event Question
    By JeRz in forum Programming
    Replies: 2
    Last Post: 10-19-2016, 09:41 AM
  4. Replies: 4
    Last Post: 08-09-2015, 10:03 AM
  5. cbo Issue and On Current Event
    By buckwheat in forum Access
    Replies: 10
    Last Post: 08-29-2013, 11:39 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