Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
|
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access 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 January 2nd, 2007, 01:51 AM
Registered User
 
Join Date: Jan 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Searchbar and Database problems

Hi guys

im still a novice in ms access, could anyone teach me how to create a search bar where i can search for records and another search bar where i can search records according from a start date to and ending date
 
Old January 3rd, 2007, 04:01 PM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

When you say searchbar, I think you mean combo box.
If you use the combo box wizard, you can create a look up that will allow you to find records on your form (search for records).

You can also create two combo boxes on a form, have one look up start dates, and one look up end dates (Unique Values = Yes). Call them cboStart and cboEnd.

Then create your report or form based on a query of the data you want to see, and then in the start date criteria line of the query put:

[Forms]![frmMyFormName].[cboStart]

And on the criteria line for the end date, put:

[Forms]![frmMyFormName].[cboEnd]

Then create a button to open the form or report. You may want to add code like:

If IsNull(Me.cboStart) Or Me.cboStart = "" Then
   Msgbox "Please select a start date.", vbCritical
   Exit Sub
End If
If IsNull(Me.cboEnd) Or Me.cboEnd = "" Then
   Msgbox "Please select an end date.", vbCritical
   Exit Sub
End If

This will prevent users from pulling a report with no start or end dates.

HTH





mmcdonal
 
Old January 12th, 2007, 11:04 AM
Registered User
 
Join Date: Jan 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

all right i will try it out
thanks





Similar Threads
Thread Thread Starter Forum Replies Last Post
Problems restoring database thomasah SQL Server 2005 0 June 12th, 2007 05:01 AM
Problems with database saif44 ASP.NET 2.0 Professional 2 November 19th, 2006 06:40 AM
Database Connection Problems Roy Ng Dreamweaver (all versions) 3 August 15th, 2005 09:36 AM
Please help - Database problems! highcliffevillage Classic ASP Basics 2 July 7th, 2004 08:43 AM
Problems with database Qing JSP Basics 0 July 7th, 2003 09:54 AM





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