Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old January 2nd, 2007, 01:51 AM
Registered User
 
Join Date: Jan 2007
Location: singapore, singapore, Singapore.
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
Reply With Quote
  #2 (permalink)  
Old January 3rd, 2007, 04:01 PM
Friend of Wrox
Points: 9,611, Level: 42
Points: 9,611, Level: 42 Points: 9,611, Level: 42 Points: 9,611, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2004
Location: Washington, DC, USA.
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
Reply With Quote
  #3 (permalink)  
Old January 12th, 2007, 11:04 AM
Registered User
 
Join Date: Jan 2007
Location: singapore, singapore, Singapore.
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

all right i will try it out
thanks
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 07:10 AM.


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