Solved

Form isn't opening to specified record

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

Accepted Solution

by:
Rey Obrero earned 500 total points
Comment Utility
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
Comment Utility
This worked...

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

Thanks!
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Introduction When developing Access applications, often we need to know whether an object exists.  This article presents a quick and reliable routine to determine if an object exists without that object being opened. If you wanted to inspect/ite…
I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
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…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

743 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now