Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 434
  • Last Modified:

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

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
GNOVAK
Asked:
GNOVAK
1 Solution
 
pteranodon72Commented:
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
 
GNOVAKAuthor Commented:
Thanks!  Great!
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now