By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,940 Members | 611 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,940 IT Pros & Developers. It's quick & easy.

A2K - allowing multiple dates in continuous form

P: n/a
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
Share this Question
Share on Google+
3 Replies


P: n/a
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

P: n/a
"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

P: n/a
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.