Solved

question on search in a form

Posted on 2014-02-19
2
279 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
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…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

760 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

21 Experts available now in Live!

Get 1:1 Help Now