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


find button ?

Posted on 1999-07-05
Medium Priority
Last Modified: 2010-05-02
what should i write behind a find button, in order for me to build a find function. i use inputbox for input. the text i key in will be bound to database with id. the problem is what should i write in order for me to get the id and find the correct information and display in the form.
Question by:pohkong
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
1 Comment

Accepted Solution

simonbennett earned 100 total points
ID: 1522042

Form is called frmFrom
Table is called Country
We are searching the CountryName field for the value typed in
The form is bound using a datacontrol called Data1

public sub cmdSearch_onclick()

 dim strData as string
 strData = inputbox("Which country?")
 if len(strdata)<1 then
  msgbox "You must enter data!
  exit sub

 frmform.data1.recordset.findfirst("CountryName = '" & trim(strdata) & "'")
 if frmform.data1.recordset.nomatch then
  msgbox "Data '" & strdata & "' not found."
 end if
end sub



Featured Post


Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

661 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