Solved

Open a Form to text and not ID

Posted on 2015-02-22
3
97 Views
Last Modified: 2015-02-22
Experts, I am trying to open a form to 2 criteria.  It seemed to work just fine with one criteria but there seems to be an error in the second criteria in this section:   & "[Timing]= '" & Me!txtTiming & "'"

    DoCmd.OpenForm "frmCovenantHistory", acFormDS, , "[Description]= '" & Me!txtDescription & "'" & "[Timing]= '" & Me!txtTiming & "'"


Please let me know how to open a form with 2 criteria.  This is not the preferred way to open the form but I am working with raw data from an import and there is no ID.  

thank you
0
Comment
Question by:pdvsa
3 Comments
 
LVL 22

Accepted Solution

by:
rspahitz earned 500 total points
ID: 40624973
You need to put some kind of joining command between the two, such as AND:

 DoCmd.OpenForm "frmCovenantHistory", acFormDS, , "[Description]= '" & Me!txtDescription & "' AND " & "[Timing]= '" & Me!txtTiming & "'"

Open in new window

0
 
LVL 29

Expert Comment

by:IrogSinta
ID: 40624984
You are missing a logical operator such as AND or OR.  In your case, you probably want AND so that the returned records meet both criteria.

DoCmd.OpenForm "frmCovenantHistory", acFormDS, , "[Description]= '" & Me!txtDescription & "' AND [Timing]= '" & Me!txtTiming & "'"

Open in new window


Ron
0
 

Author Closing Comment

by:pdvsa
ID: 40625037
Thank you....worked perfectly.
0

Featured Post

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

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

Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

680 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