Dear Campagna
I am really very sorry, bcz I am using your code with combo box, cause
for
using the combo box for select date criteria is that, I am using a pop
up
calendar with its "On Mouse over" & "On Mouse Down" Event but when I
Change
these combo Boxes with Text Boxes your code working Properly.....Let me
apologies for this.
:
Abdul,
Whenever you have trouble with code that has been suggested as a
fix,
please cut & paste the code "exactly" into your reply.
We need to see that you implemented that code properly.
I can find nothing wrong with my code, and I've also included other
solutions previously posted in the Access newsgroups.
They each use the methods I suggested.
-----------------------------
Subject: Re: Show all dates if user does not enter a date range
Anyone know how to get around this for dates??
Try
= NZ([Forms]![Search Form]![txtStartDate], #1/1/100#)
and <= NZ([Forms]![Search Form]![txtEndDate], #12/31/9999#)
------------------------------
Subject: Re: Desperate for Criteria Help!
Try this as your criteria:
(This method uses an input box to prompt for the 2 dates...
replace
the
Input prompts with the location on your date range form and fields)
Between NZ([Enter Start Date],#1/1/1900#) And NZ([Enter End
Date],#12/31/2999#)
If the user enters nothing for the start date, the query will
return
all
dates
between 1-1-1900 and the [Enter End Date].
If the user enters nothing for the end date, the query will return
all
dates
between the [Enter Start Date] and 12-31-2999.
If the user leaves both input fields blank, the query will return
all
dates
between 1-1-1900 and 12-31-2999.
------------------------------
As you can see, both methods I suggested should work.
Copy your code exactly in your reply, and describe in detail where
you
used it.
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html
"Find a job that you love... and you'll never work a day in your
life."
message
Dear Al Campagna,
your given code is also not working error occures.
This expression is typed incorrectly, or it is too complex to be
evaluated.
for example, a numeric expression may contain too many complicated
elements,
try simplifying the expression by assigning parts of expression to
variables."
:
Abdul Shakeel,
I don't understand your error
"Too Many Comples Expression"
What is "Comples?"
And, are you saying that the code I suggested works sometimes
and
not
other times?
Try...
= NZ([Forms]![Search Form]![txtStartDate], #1/1/1900#)
And <= NZ([Forms]![Search Form]![txtEndDate], #12/31/2099#)
Just another way to phrase it...
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html
"Find a job that you love... and you'll never work a day in
your
life."
message
Thanks Campagna for your reply your code works really well but
some
errors
occures whe I try to use it as:
Between Nz([Forms]![frmSelection]![BeginningDate],#01/01/1900#)
And
Nz([Forms]![frmSelection]![EndingDate],#01/01/2099#)
a "Too Many Comples Expression" massage appears could you help me
in
this
metter.
:
Abdul,
This criteria for your Date field. (all on one line)
Between NZ([Enter Start Date],#1/1/1900#) And NZ([Enter
End
Date],#12/31/2999#)
If your date fields are null, all records with a date
between
year
1900
and year 2999 will be returned.
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html
"Find a job that you love... and you'll never work a day in
your
life."
in
message
Thanx for your reply, I have one more question for you, I have
a
bank
Account
Management DB, when user try to look their bank statement a
pop
up
form
appears and ask for "start date", "end date" & "Bank Name" if
user
give
all
the details required, report would be shown otherwise not but
a
problem
occures when it lefts any field blank report not shows any
data
which I
think
wrong, I want if user left empty the "Start Date" and "End
Date"
fields
blank
reprot shows all data of all dates
:
Abdul,
Such is the nature of Autonumbers. Access always
maintains
the
last
autonumber given out, and increments by 1.
If you want a more sequential numbering, try creating a
numeric
field
for your table (ex. RecID), and... on your data entry form,
make
the
default
for that field...
= NZ(DMax("[RecID]","tblYourTable")) + 1
Whenever a new record is created, the RecID will examine
the
table...
get the max number used to date, and add 1.
In your example, after RecID = 10 is deleted from the
table,
the
next
number given out will be RecID = 10.
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html
"Find a job that you love... and you'll never work a day
in
your
life."
"Abdul Shakeel" <
[email protected]>
wrote
in
message
Hi All,
When I set a field type auto number it generates
incremental
number
every
time when add a new record but when I delete a record it
skips
the
deleted
record number & jumps to next number e.g. I enter record
number 1
2
3
...
10
if I delete number 10 record the next record I enter will
be
11
but
I
want
it
should be 10. Please help me.