Results 1 to 6 of 6
  1. #1
    Autoclave is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Oct 2011
    Posts
    7

    addressing a field that is not added to the form

    Good day everyone,

    I have a form that does not have included all the fields from the record source query.

    Within VBA I can get the values of added fields to the forms by using
    Me.FieldName.

    How do I get the values of those fields that are not included in the form?
    the "Me." does not "see" them. (I don't want to add invisible fields)



    Thank you very much, and sorry for the probably stupid question.

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Me!FieldName will pull the field from the RecordSource.

  3. #3
    hertfordkc is offline 18 year novice
    Windows XP Access 2007
    Join Date
    Mar 2011
    Posts
    481

    More info, please

    Quote Originally Posted by Autoclave View Post
    Good day everyone,

    I have a form that does not have included all the fields from the record source query.
    But the query does include all of the fields of interest?
    Within VBA I can get the values of added fields to the forms by using
    Me.FieldName. added fields to the form?? are these fields added after an initial design, fields added to a template, Are you saying that you can get the value you are seeking by this method, but you can't get them if you don't have a field?

    How do I get the values of those fields that are not included in the form?
    the "Me." does not "see" them. (I don't want to add invisible fields) Maybe Querys!Queryname!fieldname.value

    Thank you very much, and sorry for the probably stupid question.
    Keep writing.
    Last edited by hertfordkc; 10-29-2011 at 05:41 PM. Reason: Rural

  4. #4
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Me.ControlName references the Control on your form named ControlName. When you use a bang (!) instead of a dot (.) Access will look for the "Name" in the RecordSource.

  5. #5
    Autoclave is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Oct 2011
    Posts
    7
    Sorry, I am an idiot. The field I was looking for was actually not included in the record source query at all. This is why I could not see it.

    PS: I am a little shocked by all these bazillion methods of addressing same stuff in access and VBA.

  6. #6
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    That would definately put a bind in the referencing process.

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

Similar Threads

  1. New record not being added to main form
    By hmcquade in forum Forms
    Replies: 10
    Last Post: 07-21-2011, 10:07 AM
  2. Replies: 4
    Last Post: 05-17-2011, 06:56 AM
  3. Extra space added
    By allenf in forum Forms
    Replies: 2
    Last Post: 07-25-2010, 06:57 AM
  4. # added to string with Dlookup
    By normever in forum Programming
    Replies: 1
    Last Post: 02-27-2009, 10:52 AM
  5. Control addressing on subforms
    By JB in forum Access
    Replies: 1
    Last Post: 12-09-2005, 09:14 PM

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