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
Solved

question on search in a form

Posted on 2014-02-19
2
285 Views
Last Modified: 2014-02-19
Hello,
attaching database-
when you open it -  you will see form [frmSearch]
I use this code in unbound textbox in header:*****************************
Private Sub txtOne_AfterUpdate()
If Nz(DLookup("[TTID]", "tbl1", "[TTID]=" & Chr(34) & Me.txtOne & Chr(34)), "") > "" Then
       Me.Requery
       Me.Computers.SetFocus      
Else
MsgBox "TTID does not exit!"
Me.txtOne = ""
Cancel = True
End If
End Sub
************************************
I have a database where I use this and am able to have form open with just the unbound text box and then user enters TTID number- hits enter and then the form displays the full form with [qty], [so#], and [TTID]-

NOW- when open the form and a the query the form is based on - brings up an [enter parameter form] -

can you see what i am not doing or doing wrong?
thank you
Example-A1.accdb
0
Comment
Question by:davetough
2 Comments
 
LVL 84

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 500 total points
ID: 39870450
Generally when you get this error it's because you're asking Access for a field that does not exist, so check your table and field names, as well as Control names, for correct spelling. Also, remove the square brackets in the first argument:

If Nz(DLookup("TTID", "tbl1", "[TTID]=" & Chr(34) & Me.txtOne & Chr(34)), "") > "" Then
0
 

Author Closing Comment

by:davetough
ID: 39870570
thanks!! named form incorrectly
0

Featured Post

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

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

Suggested Solutions

The first two articles in this short series — Using a Criteria Form to Filter Records (http://www.experts-exchange.com/A_6069.html) and Building a Custom Filter (http://www.experts-exchange.com/A_6070.html) — discuss in some detail how a form can be…
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 functions 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 Ac…
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…

808 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