469,950 Members | 2,480 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,950 developers. It's quick & easy.

A2K - allowing multiple dates in continuous form

Here's a good one that keeps defeating me...

I have a continuous form that has a date textbox as one of the controls.
The user can choose any date they like including one they have already
entered before.
If the date they have just entered is already present I want to warn them
and give them the option to keep the date or blank it.

I couldn't get a dlookup to work for some unknown reason so now i'm looping
through a recordset and the codes getting more complicated by the hour
especially when you throw in the validation aspects.

Any ideas about how to implement this well?

thanks
Martin
Nov 12 '05 #1
3 1960
Deano wrote:
Here's a good one that keeps defeating me...

I have a continuous form that has a date textbox as one of the
controls. The user can choose any date they like including one they
have already entered before.
If the date they have just entered is already present I want to warn
them and give them the option to keep the date or blank it.

I couldn't get a dlookup to work for some unknown reason so now i'm
looping through a recordset and the codes getting more complicated by
the hour especially when you throw in the validation aspects.

Any ideas about how to implement this well?

thanks
Martin


And another thing;

I am trying to put some code in the afterupdate event of the date textbox to
check to see if it's unique or not. The event only fires if i remove the
date and move off it. If I enter a date, either manually or using a date
picker, nothing happens!!

Anyone know why this is so? I really need this event to fire.

thanks
Martin
Nov 12 '05 #2
"Deano" <ma************@hotmail.com> wrote in
news:ek*******************@wards.force9.net:
Deano wrote:
Here's a good one that keeps defeating me...

I have a continuous form that has a date textbox as one of
the controls. The user can choose any date they like
including one they have already entered before.
If the date they have just entered is already present I want
to warn them and give them the option to keep the date or
blank it.

I couldn't get a dlookup to work for some unknown reason so
now i'm looping through a recordset and the codes getting
more complicated by the hour especially when you throw in the
validation aspects.

Any ideas about how to implement this well?

thanks
Martin
And another thing;

I am trying to put some code in the afterupdate event of the
date textbox to check to see if it's unique or not. The event
only fires if i remove the date and move off it. If I enter a
date, either manually or using a date picker, nothing
happens!!

Anyone know why this is so? I really need this event to fire.

thanks
Martin


I suspect that your woes with both problems stem from using the
AfterUpdate event instead of BeforeUpdate, and/or the textbox's
value property instead of its .text property.

Instead of Dlookup or looping through a recordset, try

Me.RecordsetClone.FindFirst "Senioriter = #" & Me.Text8.Text & "#"
If Me.RecordsetClone.NoMatch Then
'Date will be unique
MsgBox "date not found"
Else
MsgBox "date found !!!!"
'display warning
End If

Bob


Nov 12 '05 #3
Bob Quintal wrote:
"Deano" <ma************@hotmail.com> wrote in
news:ek*******************@wards.force9.net:
Deano wrote:
Here's a good one that keeps defeating me...

I have a continuous form that has a date textbox as one of
the controls. The user can choose any date they like
including one they have already entered before.
If the date they have just entered is already present I want
to warn them and give them the option to keep the date or
blank it.

I couldn't get a dlookup to work for some unknown reason so
now i'm looping through a recordset and the codes getting
more complicated by the hour especially when you throw in the
validation aspects.

Any ideas about how to implement this well?

thanks
Martin


And another thing;

I am trying to put some code in the afterupdate event of the
date textbox to check to see if it's unique or not. The event
only fires if i remove the date and move off it. If I enter a
date, either manually or using a date picker, nothing
happens!!

Anyone know why this is so? I really need this event to fire.

thanks
Martin


I suspect that your woes with both problems stem from using the
AfterUpdate event instead of BeforeUpdate, and/or the textbox's
value property instead of its .text property.

Instead of Dlookup or looping through a recordset, try

Me.RecordsetClone.FindFirst "Senioriter = #" & Me.Text8.Text & "#"
If Me.RecordsetClone.NoMatch Then
'Date will be unique
MsgBox "date not found"
Else
MsgBox "date found !!!!"
'display warning
End If

Bob


Thanks i'm playing around with that but still having problems with either
the BeforeUpdate OR AfterUpdate firing. They only fire it I remove the date
from the textbox and move off.
The only way I can get any code to execute is if I place it in the LostFocus
event which is less than ideal!

I'm using an input mask for the date in the textbox - would that present a
problem? (just about to test that....)
Nov 12 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Richard Hollenbeck | last post: by
3 posts views Thread by Greg Neef | last post: by
reply views Thread by MHenry | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.