Solved

Form isn't opening to specified record

Posted on 2014-07-18
2
264 Views
Last Modified: 2014-07-18
I have a command button on a form which when clicked is supposed to open a second form to a specified criteria.  Here is my code.  But it isn't working.  The second form is opening instead to the first record in the record source.  If a record doesn't exist yet for AssetN then the form is to open for a new record entry.

DoCmd.OpenForm "frmAssetRoomDetails", acNormal, "", [AssetN] = Me.txtAssetN, , acNormal

???
0
Comment
Question by:SteveL13
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 500 total points
ID: 40204527
if AssetN is Number

DoCmd.OpenForm "frmAssetRoomDetails", acNormal, "", "[AssetN] =" & Me.txtAssetN, , acNormal

if AssetN is TEXT

DoCmd.OpenForm "frmAssetRoomDetails", acNormal, "", "[AssetN] ='" & Me.txtAssetN & "'", , acNormal
0
 

Author Comment

by:SteveL13
ID: 40204537
This worked...

DoCmd.OpenForm "frmAssetRoomDetails", acNormal, "", "[AssetN] =" & Me.txtAssetN, , acNormal

Thanks!
0

Featured Post

Technology Partners: 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!

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.
The Windows Phone Theme Colours is a tight, powerful, and well balanced palette. This tiny Access application makes it a snap to select and pick a value. And it doubles as an intro to implementing WithEvents, one of Access' hidden gems.
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 Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

623 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