Block Specified Date

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a table with a list of dates "BlockedDates" that are days the office
is closed or is a holiday. On a form there is date field that when double
clicked, opens up a calendar. When a date is chosen on the calendar, the date
is put in that field. How do I prevent someone from choosing a date that is
listed in the BlockedDates table? Either by MsgBox, Validation Rule,
whatever.

Thanks SOOO Much for the help
-Doug
 
Since I don't know the name of the textbox (not a field, fields are in
tables) the date goes in, the name of your table, or the name of the field in
the table that has the blocked dates, I will make them up and you can change
the code to meet your needs. Put this in the Before Update event of the text
box on the form where the date in entered from the calendar:

If Not IsNull(DLookup("[BLOCKED_DATE]","BlockedDateTable", _
"[BLOCKED_DATE] = #" & Me.txtDateFromCalendar & "#")) Then
MsgBox Me.txtDateFromCalendar & " Is Blocked"
Cancel = True
End If
 
Sorry about that...

Textbox name is txttourdate
Table Name is tblblockdates
Field name that has the blocked dates is BlockedDates

Anyway, I did what you said for the BeforeUpdate event of the txttourdate box:

Private Sub txttourdate_BeforeUpdate(Cancel As Integer)
If Not IsNull(DLookup("[BlockedDate]", "tblblockdates", _
"[BlockedDate] = #" & Me.txttourdate & "#")) Then
MsgBox Me.txttourdate & " Is Blocked"
Cancel = True
End If
End Sub

One of the dates in the BlockedDates is 12/18/2005. When I choose that date
for the txttourdate box, I do not get the error message. Let me know what you
think, and thanks a lot for the help!
-Doug

Klatuu said:
Since I don't know the name of the textbox (not a field, fields are in
tables) the date goes in, the name of your table, or the name of the field in
the table that has the blocked dates, I will make them up and you can change
the code to meet your needs. Put this in the Before Update event of the text
box on the form where the date in entered from the calendar:

If Not IsNull(DLookup("[BLOCKED_DATE]","BlockedDateTable", _
"[BLOCKED_DATE] = #" & Me.txtDateFromCalendar & "#")) Then
MsgBox Me.txtDateFromCalendar & " Is Blocked"
Cancel = True
End If

Doug Dickey said:
I have a table with a list of dates "BlockedDates" that are days the office
is closed or is a holiday. On a form there is date field that when double
clicked, opens up a calendar. When a date is chosen on the calendar, the date
is put in that field. How do I prevent someone from choosing a date that is
listed in the BlockedDates table? Either by MsgBox, Validation Rule,
whatever.

Thanks SOOO Much for the help
-Doug
 
Is it just that one blocked date that doesn't get the message?
Do all the others get it?
Do any dates not in the table get the message?

Doug Dickey said:
Sorry about that...

Textbox name is txttourdate
Table Name is tblblockdates
Field name that has the blocked dates is BlockedDates

Anyway, I did what you said for the BeforeUpdate event of the txttourdate box:

Private Sub txttourdate_BeforeUpdate(Cancel As Integer)
If Not IsNull(DLookup("[BlockedDate]", "tblblockdates", _
"[BlockedDate] = #" & Me.txttourdate & "#")) Then
MsgBox Me.txttourdate & " Is Blocked"
Cancel = True
End If
End Sub

One of the dates in the BlockedDates is 12/18/2005. When I choose that date
for the txttourdate box, I do not get the error message. Let me know what you
think, and thanks a lot for the help!
-Doug

Klatuu said:
Since I don't know the name of the textbox (not a field, fields are in
tables) the date goes in, the name of your table, or the name of the field in
the table that has the blocked dates, I will make them up and you can change
the code to meet your needs. Put this in the Before Update event of the text
box on the form where the date in entered from the calendar:

If Not IsNull(DLookup("[BLOCKED_DATE]","BlockedDateTable", _
"[BLOCKED_DATE] = #" & Me.txtDateFromCalendar & "#")) Then
MsgBox Me.txtDateFromCalendar & " Is Blocked"
Cancel = True
End If

Doug Dickey said:
I have a table with a list of dates "BlockedDates" that are days the office
is closed or is a holiday. On a form there is date field that when double
clicked, opens up a calendar. When a date is chosen on the calendar, the date
is put in that field. How do I prevent someone from choosing a date that is
listed in the BlockedDates table? Either by MsgBox, Validation Rule,
whatever.

Thanks SOOO Much for the help
-Doug
 
None of the dates specified trigger the msgbox. I tried some dates that
weren't listed as blocked dates and nothing showed up either.

Klatuu said:
Is it just that one blocked date that doesn't get the message?
Do all the others get it?
Do any dates not in the table get the message?

Doug Dickey said:
Sorry about that...

Textbox name is txttourdate
Table Name is tblblockdates
Field name that has the blocked dates is BlockedDates

Anyway, I did what you said for the BeforeUpdate event of the txttourdate box:

Private Sub txttourdate_BeforeUpdate(Cancel As Integer)
If Not IsNull(DLookup("[BlockedDate]", "tblblockdates", _
"[BlockedDate] = #" & Me.txttourdate & "#")) Then
MsgBox Me.txttourdate & " Is Blocked"
Cancel = True
End If
End Sub

One of the dates in the BlockedDates is 12/18/2005. When I choose that date
for the txttourdate box, I do not get the error message. Let me know what you
think, and thanks a lot for the help!
-Doug

Klatuu said:
Since I don't know the name of the textbox (not a field, fields are in
tables) the date goes in, the name of your table, or the name of the field in
the table that has the blocked dates, I will make them up and you can change
the code to meet your needs. Put this in the Before Update event of the text
box on the form where the date in entered from the calendar:

If Not IsNull(DLookup("[BLOCKED_DATE]","BlockedDateTable", _
"[BLOCKED_DATE] = #" & Me.txtDateFromCalendar & "#")) Then
MsgBox Me.txtDateFromCalendar & " Is Blocked"
Cancel = True
End If

:

I have a table with a list of dates "BlockedDates" that are days the office
is closed or is a holiday. On a form there is date field that when double
clicked, opens up a calendar. When a date is chosen on the calendar, the date
is put in that field. How do I prevent someone from choosing a date that is
listed in the BlockedDates table? Either by MsgBox, Validation Rule,
whatever.

Thanks SOOO Much for the help
-Doug
 
I wonder if this is a formatting issue. Is the data type in your table Date?
If so, what format?
Also, try this:
In the immediate window of your VB editor, type in
? DLookup("[BlockedDate]", "tblblockdates", "[BlockedDate] = #12/18/2005#")
If it returns Null, then it is a date format issue; otherwise, we have a
problem we haven't figured out yet.

One other thing I just noticed. you said the field name is BlockedDates but
your code referes to it as BlockedDate. It should cause an error if you use
a field name that is not in the table, but we need to be sure.

Doug Dickey said:
None of the dates specified trigger the msgbox. I tried some dates that
weren't listed as blocked dates and nothing showed up either.

Klatuu said:
Is it just that one blocked date that doesn't get the message?
Do all the others get it?
Do any dates not in the table get the message?

Doug Dickey said:
Sorry about that...

Textbox name is txttourdate
Table Name is tblblockdates
Field name that has the blocked dates is BlockedDates

Anyway, I did what you said for the BeforeUpdate event of the txttourdate box:

Private Sub txttourdate_BeforeUpdate(Cancel As Integer)
If Not IsNull(DLookup("[BlockedDate]", "tblblockdates", _
"[BlockedDate] = #" & Me.txttourdate & "#")) Then
MsgBox Me.txttourdate & " Is Blocked"
Cancel = True
End If
End Sub

One of the dates in the BlockedDates is 12/18/2005. When I choose that date
for the txttourdate box, I do not get the error message. Let me know what you
think, and thanks a lot for the help!
-Doug

:

Since I don't know the name of the textbox (not a field, fields are in
tables) the date goes in, the name of your table, or the name of the field in
the table that has the blocked dates, I will make them up and you can change
the code to meet your needs. Put this in the Before Update event of the text
box on the form where the date in entered from the calendar:

If Not IsNull(DLookup("[BLOCKED_DATE]","BlockedDateTable", _
"[BLOCKED_DATE] = #" & Me.txtDateFromCalendar & "#")) Then
MsgBox Me.txtDateFromCalendar & " Is Blocked"
Cancel = True
End If

:

I have a table with a list of dates "BlockedDates" that are days the office
is closed or is a holiday. On a form there is date field that when double
clicked, opens up a calendar. When a date is chosen on the calendar, the date
is put in that field. How do I prevent someone from choosing a date that is
listed in the BlockedDates table? Either by MsgBox, Validation Rule,
whatever.

Thanks SOOO Much for the help
-Doug
 
The data type is date/time and is in the short date format
I also fixed the code so that it is BlockedDates (as it should be) instead
of BlockedDate. (Weird cause no error message came up)

How do I go about doing that null test in the VB editor, does it matter
where I put it?

Klatuu said:
I wonder if this is a formatting issue. Is the data type in your table Date?
If so, what format?
Also, try this:
In the immediate window of your VB editor, type in
? DLookup("[BlockedDate]", "tblblockdates", "[BlockedDate] = #12/18/2005#")
If it returns Null, then it is a date format issue; otherwise, we have a
problem we haven't figured out yet.

One other thing I just noticed. you said the field name is BlockedDates but
your code referes to it as BlockedDate. It should cause an error if you use
a field name that is not in the table, but we need to be sure.

Doug Dickey said:
None of the dates specified trigger the msgbox. I tried some dates that
weren't listed as blocked dates and nothing showed up either.

Klatuu said:
Is it just that one blocked date that doesn't get the message?
Do all the others get it?
Do any dates not in the table get the message?

:

Sorry about that...

Textbox name is txttourdate
Table Name is tblblockdates
Field name that has the blocked dates is BlockedDates

Anyway, I did what you said for the BeforeUpdate event of the txttourdate box:

Private Sub txttourdate_BeforeUpdate(Cancel As Integer)
If Not IsNull(DLookup("[BlockedDate]", "tblblockdates", _
"[BlockedDate] = #" & Me.txttourdate & "#")) Then
MsgBox Me.txttourdate & " Is Blocked"
Cancel = True
End If
End Sub

One of the dates in the BlockedDates is 12/18/2005. When I choose that date
for the txttourdate box, I do not get the error message. Let me know what you
think, and thanks a lot for the help!
-Doug

:

Since I don't know the name of the textbox (not a field, fields are in
tables) the date goes in, the name of your table, or the name of the field in
the table that has the blocked dates, I will make them up and you can change
the code to meet your needs. Put this in the Before Update event of the text
box on the form where the date in entered from the calendar:

If Not IsNull(DLookup("[BLOCKED_DATE]","BlockedDateTable", _
"[BLOCKED_DATE] = #" & Me.txtDateFromCalendar & "#")) Then
MsgBox Me.txtDateFromCalendar & " Is Blocked"
Cancel = True
End If

:

I have a table with a list of dates "BlockedDates" that are days the office
is closed or is a holiday. On a form there is date field that when double
clicked, opens up a calendar. When a date is chosen on the calendar, the date
is put in that field. How do I prevent someone from choosing a date that is
listed in the BlockedDates table? Either by MsgBox, Validation Rule,
whatever.

Thanks SOOO Much for the help
-Doug
 
Type it in the immediate window just like I wrote it. If it finds the date,
the date will display. If it finds nothing, it will display Null

Doug Dickey said:
The data type is date/time and is in the short date format
I also fixed the code so that it is BlockedDates (as it should be) instead
of BlockedDate. (Weird cause no error message came up)

How do I go about doing that null test in the VB editor, does it matter
where I put it?

Klatuu said:
I wonder if this is a formatting issue. Is the data type in your table Date?
If so, what format?
Also, try this:
In the immediate window of your VB editor, type in
? DLookup("[BlockedDate]", "tblblockdates", "[BlockedDate] = #12/18/2005#")
If it returns Null, then it is a date format issue; otherwise, we have a
problem we haven't figured out yet.

One other thing I just noticed. you said the field name is BlockedDates but
your code referes to it as BlockedDate. It should cause an error if you use
a field name that is not in the table, but we need to be sure.

Doug Dickey said:
None of the dates specified trigger the msgbox. I tried some dates that
weren't listed as blocked dates and nothing showed up either.

:

Is it just that one blocked date that doesn't get the message?
Do all the others get it?
Do any dates not in the table get the message?

:

Sorry about that...

Textbox name is txttourdate
Table Name is tblblockdates
Field name that has the blocked dates is BlockedDates

Anyway, I did what you said for the BeforeUpdate event of the txttourdate box:

Private Sub txttourdate_BeforeUpdate(Cancel As Integer)
If Not IsNull(DLookup("[BlockedDate]", "tblblockdates", _
"[BlockedDate] = #" & Me.txttourdate & "#")) Then
MsgBox Me.txttourdate & " Is Blocked"
Cancel = True
End If
End Sub

One of the dates in the BlockedDates is 12/18/2005. When I choose that date
for the txttourdate box, I do not get the error message. Let me know what you
think, and thanks a lot for the help!
-Doug

:

Since I don't know the name of the textbox (not a field, fields are in
tables) the date goes in, the name of your table, or the name of the field in
the table that has the blocked dates, I will make them up and you can change
the code to meet your needs. Put this in the Before Update event of the text
box on the form where the date in entered from the calendar:

If Not IsNull(DLookup("[BLOCKED_DATE]","BlockedDateTable", _
"[BLOCKED_DATE] = #" & Me.txtDateFromCalendar & "#")) Then
MsgBox Me.txtDateFromCalendar & " Is Blocked"
Cancel = True
End If

:

I have a table with a list of dates "BlockedDates" that are days the office
is closed or is a holiday. On a form there is date field that when double
clicked, opens up a calendar. When a date is chosen on the calendar, the date
is put in that field. How do I prevent someone from choosing a date that is
listed in the BlockedDates table? Either by MsgBox, Validation Rule,
whatever.

Thanks SOOO Much for the help
-Doug
 
It's prompting me to enter a date when I put the form back in view mode

Klatuu said:
Type it in the immediate window just like I wrote it. If it finds the date,
the date will display. If it finds nothing, it will display Null

Doug Dickey said:
The data type is date/time and is in the short date format
I also fixed the code so that it is BlockedDates (as it should be) instead
of BlockedDate. (Weird cause no error message came up)

How do I go about doing that null test in the VB editor, does it matter
where I put it?

Klatuu said:
I wonder if this is a formatting issue. Is the data type in your table Date?
If so, what format?
Also, try this:
In the immediate window of your VB editor, type in
? DLookup("[BlockedDate]", "tblblockdates", "[BlockedDate] = #12/18/2005#")
If it returns Null, then it is a date format issue; otherwise, we have a
problem we haven't figured out yet.

One other thing I just noticed. you said the field name is BlockedDates but
your code referes to it as BlockedDate. It should cause an error if you use
a field name that is not in the table, but we need to be sure.

:

None of the dates specified trigger the msgbox. I tried some dates that
weren't listed as blocked dates and nothing showed up either.

:

Is it just that one blocked date that doesn't get the message?
Do all the others get it?
Do any dates not in the table get the message?

:

Sorry about that...

Textbox name is txttourdate
Table Name is tblblockdates
Field name that has the blocked dates is BlockedDates

Anyway, I did what you said for the BeforeUpdate event of the txttourdate box:

Private Sub txttourdate_BeforeUpdate(Cancel As Integer)
If Not IsNull(DLookup("[BlockedDate]", "tblblockdates", _
"[BlockedDate] = #" & Me.txttourdate & "#")) Then
MsgBox Me.txttourdate & " Is Blocked"
Cancel = True
End If
End Sub

One of the dates in the BlockedDates is 12/18/2005. When I choose that date
for the txttourdate box, I do not get the error message. Let me know what you
think, and thanks a lot for the help!
-Doug

:

Since I don't know the name of the textbox (not a field, fields are in
tables) the date goes in, the name of your table, or the name of the field in
the table that has the blocked dates, I will make them up and you can change
the code to meet your needs. Put this in the Before Update event of the text
box on the form where the date in entered from the calendar:

If Not IsNull(DLookup("[BLOCKED_DATE]","BlockedDateTable", _
"[BLOCKED_DATE] = #" & Me.txtDateFromCalendar & "#")) Then
MsgBox Me.txtDateFromCalendar & " Is Blocked"
Cancel = True
End If

:

I have a table with a list of dates "BlockedDates" that are days the office
is closed or is a holiday. On a form there is date field that when double
clicked, opens up a calendar. When a date is chosen on the calendar, the date
is put in that field. How do I prevent someone from choosing a date that is
listed in the BlockedDates table? Either by MsgBox, Validation Rule,
whatever.

Thanks SOOO Much for the help
-Doug
 
What did it say in the immediate window? that is what we need to determine
before we go back to the form.

Doug Dickey said:
It's prompting me to enter a date when I put the form back in view mode

Klatuu said:
Type it in the immediate window just like I wrote it. If it finds the date,
the date will display. If it finds nothing, it will display Null

Doug Dickey said:
The data type is date/time and is in the short date format
I also fixed the code so that it is BlockedDates (as it should be) instead
of BlockedDate. (Weird cause no error message came up)

How do I go about doing that null test in the VB editor, does it matter
where I put it?

:

I wonder if this is a formatting issue. Is the data type in your table Date?
If so, what format?
Also, try this:
In the immediate window of your VB editor, type in
? DLookup("[BlockedDate]", "tblblockdates", "[BlockedDate] = #12/18/2005#")
If it returns Null, then it is a date format issue; otherwise, we have a
problem we haven't figured out yet.

One other thing I just noticed. you said the field name is BlockedDates but
your code referes to it as BlockedDate. It should cause an error if you use
a field name that is not in the table, but we need to be sure.

:

None of the dates specified trigger the msgbox. I tried some dates that
weren't listed as blocked dates and nothing showed up either.

:

Is it just that one blocked date that doesn't get the message?
Do all the others get it?
Do any dates not in the table get the message?

:

Sorry about that...

Textbox name is txttourdate
Table Name is tblblockdates
Field name that has the blocked dates is BlockedDates

Anyway, I did what you said for the BeforeUpdate event of the txttourdate box:

Private Sub txttourdate_BeforeUpdate(Cancel As Integer)
If Not IsNull(DLookup("[BlockedDate]", "tblblockdates", _
"[BlockedDate] = #" & Me.txttourdate & "#")) Then
MsgBox Me.txttourdate & " Is Blocked"
Cancel = True
End If
End Sub

One of the dates in the BlockedDates is 12/18/2005. When I choose that date
for the txttourdate box, I do not get the error message. Let me know what you
think, and thanks a lot for the help!
-Doug

:

Since I don't know the name of the textbox (not a field, fields are in
tables) the date goes in, the name of your table, or the name of the field in
the table that has the blocked dates, I will make them up and you can change
the code to meet your needs. Put this in the Before Update event of the text
box on the form where the date in entered from the calendar:

If Not IsNull(DLookup("[BLOCKED_DATE]","BlockedDateTable", _
"[BLOCKED_DATE] = #" & Me.txtDateFromCalendar & "#")) Then
MsgBox Me.txtDateFromCalendar & " Is Blocked"
Cancel = True
End If

:

I have a table with a list of dates "BlockedDates" that are days the office
is closed or is a holiday. On a form there is date field that when double
clicked, opens up a calendar. When a date is chosen on the calendar, the date
is put in that field. How do I prevent someone from choosing a date that is
listed in the BlockedDates table? Either by MsgBox, Validation Rule,
whatever.

Thanks SOOO Much for the help
-Doug
 
All I'm getting is a Run-time Error '2001': You cancelled the previous
operation

Klatuu said:
What did it say in the immediate window? that is what we need to determine
before we go back to the form.

Doug Dickey said:
It's prompting me to enter a date when I put the form back in view mode

Klatuu said:
Type it in the immediate window just like I wrote it. If it finds the date,
the date will display. If it finds nothing, it will display Null

:

The data type is date/time and is in the short date format
I also fixed the code so that it is BlockedDates (as it should be) instead
of BlockedDate. (Weird cause no error message came up)

How do I go about doing that null test in the VB editor, does it matter
where I put it?

:

I wonder if this is a formatting issue. Is the data type in your table Date?
If so, what format?
Also, try this:
In the immediate window of your VB editor, type in
? DLookup("[BlockedDate]", "tblblockdates", "[BlockedDate] = #12/18/2005#")
If it returns Null, then it is a date format issue; otherwise, we have a
problem we haven't figured out yet.

One other thing I just noticed. you said the field name is BlockedDates but
your code referes to it as BlockedDate. It should cause an error if you use
a field name that is not in the table, but we need to be sure.

:

None of the dates specified trigger the msgbox. I tried some dates that
weren't listed as blocked dates and nothing showed up either.

:

Is it just that one blocked date that doesn't get the message?
Do all the others get it?
Do any dates not in the table get the message?

:

Sorry about that...

Textbox name is txttourdate
Table Name is tblblockdates
Field name that has the blocked dates is BlockedDates

Anyway, I did what you said for the BeforeUpdate event of the txttourdate box:

Private Sub txttourdate_BeforeUpdate(Cancel As Integer)
If Not IsNull(DLookup("[BlockedDate]", "tblblockdates", _
"[BlockedDate] = #" & Me.txttourdate & "#")) Then
MsgBox Me.txttourdate & " Is Blocked"
Cancel = True
End If
End Sub

One of the dates in the BlockedDates is 12/18/2005. When I choose that date
for the txttourdate box, I do not get the error message. Let me know what you
think, and thanks a lot for the help!
-Doug

:

Since I don't know the name of the textbox (not a field, fields are in
tables) the date goes in, the name of your table, or the name of the field in
the table that has the blocked dates, I will make them up and you can change
the code to meet your needs. Put this in the Before Update event of the text
box on the form where the date in entered from the calendar:

If Not IsNull(DLookup("[BLOCKED_DATE]","BlockedDateTable", _
"[BLOCKED_DATE] = #" & Me.txtDateFromCalendar & "#")) Then
MsgBox Me.txtDateFromCalendar & " Is Blocked"
Cancel = True
End If

:

I have a table with a list of dates "BlockedDates" that are days the office
is closed or is a holiday. On a form there is date field that when double
clicked, opens up a calendar. When a date is chosen on the calendar, the date
is put in that field. How do I prevent someone from choosing a date that is
listed in the BlockedDates table? Either by MsgBox, Validation Rule,
whatever.

Thanks SOOO Much for the help
-Doug
 
Check your library references. Assuming you have the syntax correct, it
sounds like it can't find the Date function.

Doug Dickey said:
All I'm getting is a Run-time Error '2001': You cancelled the previous
operation

Klatuu said:
What did it say in the immediate window? that is what we need to determine
before we go back to the form.

Doug Dickey said:
It's prompting me to enter a date when I put the form back in view mode

:

Type it in the immediate window just like I wrote it. If it finds the date,
the date will display. If it finds nothing, it will display Null

:

The data type is date/time and is in the short date format
I also fixed the code so that it is BlockedDates (as it should be) instead
of BlockedDate. (Weird cause no error message came up)

How do I go about doing that null test in the VB editor, does it matter
where I put it?

:

I wonder if this is a formatting issue. Is the data type in your table Date?
If so, what format?
Also, try this:
In the immediate window of your VB editor, type in
? DLookup("[BlockedDate]", "tblblockdates", "[BlockedDate] = #12/18/2005#")
If it returns Null, then it is a date format issue; otherwise, we have a
problem we haven't figured out yet.

One other thing I just noticed. you said the field name is BlockedDates but
your code referes to it as BlockedDate. It should cause an error if you use
a field name that is not in the table, but we need to be sure.

:

None of the dates specified trigger the msgbox. I tried some dates that
weren't listed as blocked dates and nothing showed up either.

:

Is it just that one blocked date that doesn't get the message?
Do all the others get it?
Do any dates not in the table get the message?

:

Sorry about that...

Textbox name is txttourdate
Table Name is tblblockdates
Field name that has the blocked dates is BlockedDates

Anyway, I did what you said for the BeforeUpdate event of the txttourdate box:

Private Sub txttourdate_BeforeUpdate(Cancel As Integer)
If Not IsNull(DLookup("[BlockedDate]", "tblblockdates", _
"[BlockedDate] = #" & Me.txttourdate & "#")) Then
MsgBox Me.txttourdate & " Is Blocked"
Cancel = True
End If
End Sub

One of the dates in the BlockedDates is 12/18/2005. When I choose that date
for the txttourdate box, I do not get the error message. Let me know what you
think, and thanks a lot for the help!
-Doug

:

Since I don't know the name of the textbox (not a field, fields are in
tables) the date goes in, the name of your table, or the name of the field in
the table that has the blocked dates, I will make them up and you can change
the code to meet your needs. Put this in the Before Update event of the text
box on the form where the date in entered from the calendar:

If Not IsNull(DLookup("[BLOCKED_DATE]","BlockedDateTable", _
"[BLOCKED_DATE] = #" & Me.txtDateFromCalendar & "#")) Then
MsgBox Me.txtDateFromCalendar & " Is Blocked"
Cancel = True
End If

:

I have a table with a list of dates "BlockedDates" that are days the office
is closed or is a holiday. On a form there is date field that when double
clicked, opens up a calendar. When a date is chosen on the calendar, the date
is put in that field. How do I prevent someone from choosing a date that is
listed in the BlockedDates table? Either by MsgBox, Validation Rule,
whatever.

Thanks SOOO Much for the help
-Doug
 
Back
Top