Solved

Open a Form to text and not ID

Posted on 2015-02-22
3
96 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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

Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

839 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