Solved

Form isn't opening to specified record

Posted on 2014-07-18
2
257 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

Independent Software Vendors: 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

Suggested Solutions

It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

759 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