Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

question on search in a form

Posted on 2014-02-19
2
Medium Priority
?
289 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
[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 85

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 2000 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

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.
This article shows how to get a list of available printers for display in a drop-down list, and then to use the selected printer to print an Access report or a Word document filled with Access data, using different syntax as needed for working with …
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

721 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