Solved

Form isn't opening to specified record

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

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

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

Suggested Solutions

Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
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.
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…
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…

820 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