Access - code

  • Thread starter Thread starter Gal
  • Start date Start date
G

Gal

How to write in Access a "find" sentence, that finds a specific record in a
table (according to one of the fields) and displaya data from other fields?
(Eg the user enters the IDnumber of a book, and gets a message box with the
name of the book)
 
Look in Help at the DLookUp function

Msgbox DLookUp("BookName","BooksTable","IDNumber = " & IDNumber)
 
How to write in Access a "find" sentence, that finds a specific record in a
table (according to one of the fields) and displaya data from other fields?
(Eg the user enters the IDnumber of a book, and gets a message box with the
name of the book)

No "code" is needed. The tool for what you describe is a Query.

Create a new Query based on your table. Put a criterion on the Criteria line
under the IDnumber field, and include all of the fields that you want to see.

This type of query is *absolutely fundamental* to any productive use of
Access, and can and should be made much more elaborate.

You might want to check out some of the tutorials here:

Jeff Conrad's resources page:
http://www.accessmvp.com/JConrad/accessjunkie/resources.html

The Access Web resources page:
http://www.mvps.org/access/resources/index.html

Roger Carlson's tutorials, samples and tips:
http://www.rogersaccesslibrary.com/

A free tutorial written by Crystal:
http://allenbrowne.com/casu-22.html

A video how-to series by Crystal:
http://www.YouTube.com/user/LearnAccessByCrystal

MVP Allen Browne's tutorials:
http://allenbrowne.com/links.html#Tutorials
 
Back
Top