Solved

Referencing a filtered form's current record fields in Access 2007

Posted on 2013-01-22
2
417 Views
Last Modified: 2013-01-22
I have a form with a MySQL ODBC record source that is filtered to show only one record. Not all the fields from the record are bound to the form.

Is there a way to reference fields from the filtered record in VBA that are not bound?

For example, if the table has ID, field1, field2.  On the form I have myField1 that is bound to field1. The filter on the form is based on ID=2.  In VBA I would like to check the value of field2 without having to add an invisible control or without having to do a temp recordset.

I would like to use something like MyTable.field2  or currentrecord!field2 . Neither of these seem to work.
0
Comment
Question by:GNOVAK
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 14

Accepted Solution

by:
pteranodon72 earned 500 total points
ID: 38807513
You can reach the fields of the current record (whether they have bound controls or not) by using the syntax:

Me!Field2
from events within the form

or
[Forms]![YourFormName]![Field2]
from anywhere else.
You must use an exclamation point, not a period, to reach these.

HTH,
pT72
0
 

Author Closing Comment

by:GNOVAK
ID: 38807622
Thanks!  Great!
0

Featured Post

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Having trouble getting your hands on Dynamics 365 Field Service or Project Service trial? Worry No More!!!
This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question