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
| 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
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old June 1st, 2006, 07:20 AM
Friend of Wrox
Join Date: Apr 2006
Location: Ternat, , Belgium.
Posts: 159
Thanks: 0
Thanked 0 Times in 0 Posts
Default IIf problem


I have a little problem using the IIf. What I would like to have is that on a continuous form a count operation is performed.
If for exemple I'm using a 'time' field to count on, what I would like is that it counts the data if the fields value is before 14:00 and return 0 if no record has a time before 14:00. So if I have 3 fields before 14:00 (like 12:10 and 13:25 and 13:59) it has to return 3.

If I would have the fields 12:10 and 13:25 and 13:59 and 14:10 it should return 3. If i would only have 14:10 and 14:55 it has to return 0.

Does anyone knows how I have to do this? Everything I try fails...


Reply With Quote
  #2 (permalink)  
Old June 1st, 2006, 11:35 AM
Friend of Wrox
Join Date: Dec 2005
Location: , , .
Posts: 142
Thanks: 0
Thanked 0 Times in 0 Posts

You can make the continuous form a subform of another, and on that other add a text box. Assuming the record source for the continuous form is a query named 'qry', the data source for the text box should be:

SELECT(COUNT(*) FROM qry WHERE field < #14:00#)

The way the time's formatted may need to be fixed, I've not used time in a query before.

Reply With Quote

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
IIf umeshtheone Beginning VB 6 3 June 21st, 2007 12:24 AM
Help with IIF Statment Corey Access 2 December 14th, 2006 11:10 AM
Select iif problem kon SQL Language 2 March 28th, 2006 11:24 PM
IIF Statement golden Access 3 July 12th, 2004 07:49 PM

All times are GMT -4. The time now is 02:39 PM.

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