Re: Using Dates in If Then statements in Continuous Forms



On Feb 7, 11:31 am, "Douglas J. Steele"
<NOSPAM_djsteele@xxxxxxxxxxxxxxxxx> wrote:
You have no choice but to use Conditional Formatting.

While it may appear as though you've got, say, 200 text boxes named
txtAssigned on your form, in actual fact you've got one text box, repeated
200 times. Any change you make to the properties of one text box affects
them all.

--
Doug Steele, Microsoft Access MVPhttp://I.Am/DougSteele
(no e-mails, please!)

<bam...@xxxxxxxxx> wrote in message

news:1170864988.287221.231390@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

On Feb 7, 10:42 am, Stefan Hoffmann <stefan.hoffm...@xxxxxxxxxx>
wrote:
hi,

bam...@xxxxxxxxx wrote:
If I take out 'And DateDiff("d", Dt, Me.txtAssigned) > 60' the If
statement completes where the other parts are true.

Try it with switching the dates:

DateDiff("d", CDate(Me.txtAssigned), Dt)

Use the CDate() function to ensure to use a date.

mfG
--> stefan <--

still nothing. if you use msgbox (DateDiff("d", Dt, Me.txtAssigned))
it returns the same as DateDiff("d", CDate(Me.txtAssigned), Dt),
which to me means they are correctly executing the math part, but it
seems to be unable to traverse the rows. I'm really at a loss to why
it fails once the date logic is added.

I guess my confusion comes from the following code working, whereas it
stops working when using the date in the if clause.

"If Me.txtSTATUS = "OPEN" And IsNull(Me.txtNote) And txtRej_Cd =
"PENDING" Then
txtActionDt.Value = Date
Me.txtNote.Value = "AutoClose"
me.txtAction.Value = "CLS"
End If"

Thank you for the replies and the help however.

.



Relevant Pages

  • Re: Understandable documentation regarding Access DBA security
    ... "Douglas J. Steele" wrote: ... Private Sub Form_BeforeUpdate ... ' Set bound controls to system date and time and current user name. ... Doug Steele, Microsoft Access MVP ...
    (microsoft.public.access.security)
  • Re: Search Date and Time
    ... One other point (which I think was implied by Douglas Steele) is that for a range over more than a 24 hour period Bob Barrow's solution would become ... in a single Date/Time field. ... This email account is my spam trap so ...
    (microsoft.public.access.queries)
  • Re: ? auto number fix ()
    ... "Douglas J. Steele" wrote: ... Dim strConnect As String ... Doug Steele, Microsoft Access MVP ... Function AutoNumFix() As Long ...
    (microsoft.public.access.formscoding)
  • Re: find and display files
    ... "Douglas J. Steele" wrote: ... Dim strFilter As String ... Doug Steele, Microsoft Access MVP ...
    (microsoft.public.access.formscoding)
  • Re: highlighting in Multi List boxes
    ... You are correct, Douglas. ... Doug Steele, Microsoft Access MVP ... Private Sub TxtMinimumQty_AfterUpdate ... Dim intLoop As Integer ...
    (microsoft.public.access.gettingstarted)