Solved

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

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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Article by: Leon
Software Metering within our group of companies has always been an afterthought until auditing of software and licensing became a pain point. Orchestrator and SCCM metering gave us the answer and it was an exciting process.
As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

809 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