Solved

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

Posted on 2013-01-22
2
375 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
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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

The System Center Operations Manager 2012, known as SCOM, is a part of the Microsoft system center product that provides the user with infrastructure monitoring and application performance monitoring. SCOM monitors:   Windows or UNIX/LinuxNetwo…
This collection of functions covers all the normal rounding methods of just about any numeric value.
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.

708 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now