Page 2 of 2 FirstFirst 12
Results 16 to 20 of 20
  1. #16
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    6,556

    Well I would have said the Me. would be the control, and the other the field?
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  2. #17
    Miles R is offline Competent Performer
    Windows 10 Office 365
    Join Date
    Mar 2019
    Posts
    280
    Yes that is correct,
    Me. refers to a control on the form and
    Me! refers to a field in the forms record source, as is the case here.

  3. #18
    Minty is offline VIP
    Windows 10 Office 365
    Join Date
    Sep 2017
    Location
    UK - Wiltshire
    Posts
    3,157
    Quote Originally Posted by Miles R View Post
    Yes that is correct,
    Me. refers to a control on the form and
    Me! refers to a field in the forms record source, as is the case here.
    Only if they are called the same thing.


    Me!YourControlName will still find a control if one exists and there isn't a field of the same name. You won't get intellisense, as it's not pre-compiled.
    I think it's a dangerous/ambiguous way to refer to things personally.


    I will go back to my original assertion that they provide a recordset clone for really good reasons, and as previously mentioned by Moke Using the Form_ prefix is generally used when instantiating a form instance. set frm = New Form_SomeForm.
    This can have some undesired side effects.


    DLookup Syntax and others http://access.mvps.org/access/general/gen0018.htm
    Please use the star below the post to say thanks if we have helped !
    ↓↓ It's down here ↓↓

  4. #19
    moke123's Avatar
    moke123 is offline Me.Dirty=True
    Windows 11 Office 365
    Join Date
    Oct 2012
    Location
    Ma.
    Posts
    1,879
    I rarely, if ever, use a bang.

    Yes, I am adjusting the recordset, but from my testing, the record set is updated and the syntax [Form_Bird List].Recordset.Fields("TaxonomySequence") gives the correct value, but Me!TaxonomySequence.Value gives another, which does not seem to be the value in the current record.


    Which recordset are you updating? And how?
    How are you determining the value of the current record?
    It just seems odd to me to use findfirst in a form without using bookmark .
    If this helped, please click the star * at the bottom left and add to my reputation- Thanks

  5. #20
    Miles R is offline Competent Performer
    Windows 10 Office 365
    Join Date
    Mar 2019
    Posts
    280
    There is only one Recordset and it all seems to work, so not a problem.

    On the issue of not using the [Form_<form name>] terminolgy, I have done some experimenting, I can't see the benefit.

    Firstly, using the Forms("<form name>") terminology only works if the form is open (I think I am correct in saying this). This is not normally a problem when running the code, but in testing a form stand alone, it is useful to automatically instantiate a copy of the missing form.
    Secondly, it is more complicated to refer to items on subforms as you have to refer to the main form and then the subform control. Same is true, if running functions that are in the subform code from another module. I did manage to get this to work though.
    Thirdly I have the following code : Forms("Taxonomy").PopulateTaxonomyTree (this is code in the Taxonomy form)
    If I right click "Definition" on PopulateTaxonomyTree in the VB editor, it says "Item under cursor is not recognized"
    However, if I use my original terminology : [Form_Taxonomy].PopulateTaxonomyTree
    and do the same thing, the VB editor goes straight to the code in the Taxonomy form.

    I think I'll stick to using [Form_<form name>] when referring to forms.

Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 7
    Last Post: 09-28-2023, 08:41 AM
  2. How to Set Focus to a Record and Using FindFirst
    By BallinWallin in forum Programming
    Replies: 3
    Last Post: 07-20-2014, 08:05 AM
  3. recordset .findfirst question
    By RonL in forum Programming
    Replies: 4
    Last Post: 06-22-2013, 01:12 PM
  4. Recordset FindFirst Not Working
    By ShoresJohn in forum Programming
    Replies: 5
    Last Post: 03-01-2012, 06:59 PM
  5. Recordset Findfirst Problem
    By ColPat in forum Programming
    Replies: 6
    Last Post: 07-22-2010, 04:34 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