Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Excel VBA > Excel VBA
|
Excel VBA Discuss using VBA for Excel programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 7th, 2008, 02:17 AM
Registered User
 
Join Date: Feb 2008
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default How to display message box in query?

Hi, Everyone:
 When you click open to run a query on a database and type information into the Enter Parameters Value dialog box, the dialog box that displays when you click open, in this particular case a three or four digit number; and click the OK button and the information is not there: How do you get a message box to display a message? "Number not found". That is what I have been trying to do with no success. I begin by clicking on Forms in Access and then clicking on Design. Once visual Basic Forms comes up I click on the toolbox icon on the Control Menu icon toolbar. I put a text box and a command button on the form. That is as far as I go. I do not know what code to write. My database is on my C drive ("C:\lottery\lottery numbers.mdb")

Below are some of the records that are in my database. If anyone can create the database I have below you will see what I am trying to do. If you create the database below, you can just enter the first record in the field columns if you want to. Once you create the database and add a query to it and then open the query and enter a three or four digit number that is not in the database or even you can type one of the numbers that I have below in any order into the Enter Parameters Value dialog box and hit OK, a Select Query dialog box will appear with a blinking cursor in an empty record row. I can live with that because I know the number is not there. But I just want to have a message box to pop up displaying a message: "Number not found". I would appreciate anybody's help in how to write code to include a message box. Thanks. Tyrone!

I have a database that has 2 fields: Header; Three digit NH Four digit low to high
Header Three digit NH Four digit MA low to high
Book02303 1279
Book02304 008
Book02305 899
Book02306 009
Book03307 4567
Book03308 3799

In the Design menu for query the wording I used for Criteria [Type Three digit NH Four digit MA, low to high]







Similar Threads
Thread Thread Starter Forum Replies Last Post
Count in combo box(display results in text box) mboyisis Access 4 April 4th, 2008 07:08 AM
resubmitting how to display message box tsuersrb Excel VBA 1 March 10th, 2008 07:06 AM
Display Japanese characters in a message box kalyanipradeep Excel VBA 0 September 22nd, 2006 04:14 AM
How to display a Message Box creative_eye General .NET 8 February 17th, 2005 07:23 PM
Message display rodmcleay Forum and Wrox.com Feedback 1 June 5th, 2003 06:45 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.