A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Limit to List Setting + Insert Date Using Popup Calendar



 
 
Thread Tools Display Modes
  #1  
Old April 2nd, 2009, 09:29 PM posted to microsoft.public.access
JK[_4_]
external usenet poster
 
Posts: 51
Default Limit to List Setting + Insert Date Using Popup Calendar

When I try to set a combo box to limit to list (a combo with all Saturday
dates) and then I click the popup calendar button and try to insert a date
that is not a saturday date, not a date that is in the table behind the combo
- it let's me.

Any idea how I can prevent this. I'm not sure why the limit to list feature
is ignored when entering a date using a popup calendar.

Thanks,
jason
  #2  
Old April 3rd, 2009, 01:04 AM posted to microsoft.public.access
Mr B[_2_]
external usenet poster
 
Posts: 129
Default Limit to List Setting + Insert Date Using Popup Calendar

JK,

I would have to do a little testing to try an figure out the answer to your
question, but first, I have to ask:

If you already have the "Saturday" dates in a table andyour combo box is set
to Limit to List and the list of Saturday dates is populated in the combo
box, why would you then have a pop up calendar to select a date?

If you are really wanting to add another "Saturday" date to the list, I
would think that you would just add the next Saturday to the list in the
combo box.

I may be missing something really critical to what you are doing, so forgive
me if I did not get it.

--
HTH

Mr B
askdoctoraccess dot com


"JK" wrote:

When I try to set a combo box to limit to list (a combo with all Saturday
dates) and then I click the popup calendar button and try to insert a date
that is not a saturday date, not a date that is in the table behind the combo
- it let's me.

Any idea how I can prevent this. I'm not sure why the limit to list feature
is ignored when entering a date using a popup calendar.

Thanks,
jason

  #3  
Old April 3rd, 2009, 01:23 AM posted to microsoft.public.access
Linq Adams via AccessMonster.com
external usenet poster
 
Posts: 1,474
Default Limit to List Setting + Insert Date Using Popup Calendar

This is confusing to me as well! Where are you entering the date you're
selecting from the popup calendar?

--
There's ALWAYS more than one way to skin a cat!

Answers/posts based on Access 2000/2003

Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...ccess/200904/1

  #4  
Old April 3rd, 2009, 01:38 AM posted to microsoft.public.access
AccessVandal via AccessMonster.com
external usenet poster
 
Posts: 461
Default Limit to List Setting + Insert Date Using Popup Calendar

Show us the NotInList event code or did you have any?

JK wrote:
When I try to set a combo box to limit to list (a combo with all Saturday
dates) and then I click the popup calendar button and try to insert a date
that is not a saturday date, not a date that is in the table behind the combo
- it let's me.

Any idea how I can prevent this. I'm not sure why the limit to list feature
is ignored when entering a date using a popup calendar.

Thanks,
jason


--
Please Rate the posting if helps you.

Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...ccess/200904/1

  #5  
Old April 3rd, 2009, 02:16 PM posted to microsoft.public.access
JK[_4_]
external usenet poster
 
Posts: 51
Default Limit to List Setting + Insert Date Using Popup Calendar

I guess I didn't provide enough information. The combo box is bound to table
(tblSaturdayDates) and the Criteria of the field in the query is Date()-14.

The form, where the combo resides, is a form used to enter sales activity
statistics. There are many sales reps and maybe ten or so fields in the form.
When a salesperson submits their activity summary report at the end of the
week, the stats from the excel spreadsheet get entered into the database.

So the admin entering the data has to first select (or enter) the
week-ending date and then the salesperson's statistics. To make things easier
for the admin, since the week-ending date is always a saturday, I decided to
create a table with all saturday dates. This way, the admin can easily select
the date. However, if a salesperson submits their activity summary report
three weeks or more late, the saturday date would not be available in the
comobo becasue of the criteria in the query. If I remove the criteria in the
query, then the admin would have to scroll through a long list to get to the
date the person is looking for.

If a user selects a date using the pop-up calendar and that date is not a
saturday date, I want the not in list event to fire and tell the admin that
it's not a saturday date. This is why I need it to work. If the user manually
enters a date in the combo and the date is not a saturday date the not in
list event fires as intended.

I hope this makes sense and clears things up. I just don't understand why
(or how) the pop-up calendar and circumvent the not in list event. Even if
it's not a saturday date I can still insert it and save the form without any
errors.

Thanks,
Jason

"AccessVandal via AccessMonster.com" wrote:

Show us the NotInList event code or did you have any?

JK wrote:
When I try to set a combo box to limit to list (a combo with all Saturday
dates) and then I click the popup calendar button and try to insert a date
that is not a saturday date, not a date that is in the table behind the combo
- it let's me.

Any idea how I can prevent this. I'm not sure why the limit to list feature
is ignored when entering a date using a popup calendar.

Thanks,
jason


--
Please Rate the posting if helps you.

Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...ccess/200904/1


  #6  
Old April 3rd, 2009, 02:51 PM posted to microsoft.public.access
Mr. B[_3_]
external usenet poster
 
Posts: 57
Default Limit to List Setting + Insert Date Using Popup Calendar

JK,

As a suggestion, why not have your week-ending date defalut to Saturday of
the current week or if entry is done after the fact you can default to the
previous Saturday as a starting point. Then provide two buttons that will
either decrement or increment the default Saturday by 7 days each time the
appropriate button is clicked. This way the user can work on data entry for
any week at any time any you maintain the fact the dates are always a
Saturday.

Just my two cents worth.

-----
HTH
Mr. B
askdoctoraccess dot com

"JK" wrote:

I guess I didn't provide enough information. The combo box is bound to table
(tblSaturdayDates) and the Criteria of the field in the query is Date()-14.

The form, where the combo resides, is a form used to enter sales activity
statistics. There are many sales reps and maybe ten or so fields in the form.
When a salesperson submits their activity summary report at the end of the
week, the stats from the excel spreadsheet get entered into the database.

So the admin entering the data has to first select (or enter) the
week-ending date and then the salesperson's statistics. To make things easier
for the admin, since the week-ending date is always a saturday, I decided to
create a table with all saturday dates. This way, the admin can easily select
the date. However, if a salesperson submits their activity summary report
three weeks or more late, the saturday date would not be available in the
comobo becasue of the criteria in the query. If I remove the criteria in the
query, then the admin would have to scroll through a long list to get to the
date the person is looking for.

If a user selects a date using the pop-up calendar and that date is not a
saturday date, I want the not in list event to fire and tell the admin that
it's not a saturday date. This is why I need it to work. If the user manually
enters a date in the combo and the date is not a saturday date the not in
list event fires as intended.

I hope this makes sense and clears things up. I just don't understand why
(or how) the pop-up calendar and circumvent the not in list event. Even if
it's not a saturday date I can still insert it and save the form without any
errors.

Thanks,
Jason

"AccessVandal via AccessMonster.com" wrote:

Show us the NotInList event code or did you have any?

JK wrote:
When I try to set a combo box to limit to list (a combo with all Saturday
dates) and then I click the popup calendar button and try to insert a date
that is not a saturday date, not a date that is in the table behind the combo
- it let's me.

Any idea how I can prevent this. I'm not sure why the limit to list feature
is ignored when entering a date using a popup calendar.

Thanks,
jason


--
Please Rate the posting if helps you.

Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...ccess/200904/1


  #7  
Old April 4th, 2009, 04:43 PM posted to microsoft.public.access
JK[_4_]
external usenet poster
 
Posts: 51
Default Limit to List Setting + Insert Date Using Popup Calendar

That's a great idea, I just don't have the programming skills necessary to
pull it off. But maybe I'll take a stab at it when I get back to the office
on Monday. You never know, I guess, I've surprised myself in the past.

Thanks for the advice

Regards,
JK

"Mr. B" wrote:

JK,

As a suggestion, why not have your week-ending date defalut to Saturday of
the current week or if entry is done after the fact you can default to the
previous Saturday as a starting point. Then provide two buttons that will
either decrement or increment the default Saturday by 7 days each time the
appropriate button is clicked. This way the user can work on data entry for
any week at any time any you maintain the fact the dates are always a
Saturday.

Just my two cents worth.

-----
HTH
Mr. B
askdoctoraccess dot com

"JK" wrote:

I guess I didn't provide enough information. The combo box is bound to table
(tblSaturdayDates) and the Criteria of the field in the query is Date()-14.

The form, where the combo resides, is a form used to enter sales activity
statistics. There are many sales reps and maybe ten or so fields in the form.
When a salesperson submits their activity summary report at the end of the
week, the stats from the excel spreadsheet get entered into the database.

So the admin entering the data has to first select (or enter) the
week-ending date and then the salesperson's statistics. To make things easier
for the admin, since the week-ending date is always a saturday, I decided to
create a table with all saturday dates. This way, the admin can easily select
the date. However, if a salesperson submits their activity summary report
three weeks or more late, the saturday date would not be available in the
comobo becasue of the criteria in the query. If I remove the criteria in the
query, then the admin would have to scroll through a long list to get to the
date the person is looking for.

If a user selects a date using the pop-up calendar and that date is not a
saturday date, I want the not in list event to fire and tell the admin that
it's not a saturday date. This is why I need it to work. If the user manually
enters a date in the combo and the date is not a saturday date the not in
list event fires as intended.

I hope this makes sense and clears things up. I just don't understand why
(or how) the pop-up calendar and circumvent the not in list event. Even if
it's not a saturday date I can still insert it and save the form without any
errors.

Thanks,
Jason

"AccessVandal via AccessMonster.com" wrote:

Show us the NotInList event code or did you have any?

JK wrote:
When I try to set a combo box to limit to list (a combo with all Saturday
dates) and then I click the popup calendar button and try to insert a date
that is not a saturday date, not a date that is in the table behind the combo
- it let's me.

Any idea how I can prevent this. I'm not sure why the limit to list feature
is ignored when entering a date using a popup calendar.

Thanks,
jason

--
Please Rate the posting if helps you.

Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...ccess/200904/1


  #8  
Old April 5th, 2009, 04:29 AM posted to microsoft.public.access
Mr. B[_3_]
external usenet poster
 
Posts: 57
Default Limit to List Setting + Insert Date Using Popup Calendar

JK,

Don't think about trying to "eat the whole elephant". Think in terms of
doing "first things first" and then come back here and ask questions. There
are many requlars around here that will be more that glad to try to help.

Most of us can remember when "just didn' have the probramming skills" but we
have acquired them over time and now we are attempting to help others just
like you because we have received (and by the way we continue to receive)
help from others when we didn't know.

Hang in there, and good luck with your project.

Mr. B
askdoctoraccess dot com

"JK" wrote:

That's a great idea, I just don't have the programming skills necessary to
pull it off. But maybe I'll take a stab at it when I get back to the office
on Monday. You never know, I guess, I've surprised myself in the past.

Thanks for the advice

Regards,
JK

"Mr. B" wrote:

JK,

As a suggestion, why not have your week-ending date defalut to Saturday of
the current week or if entry is done after the fact you can default to the
previous Saturday as a starting point. Then provide two buttons that will
either decrement or increment the default Saturday by 7 days each time the
appropriate button is clicked. This way the user can work on data entry for
any week at any time any you maintain the fact the dates are always a
Saturday.

Just my two cents worth.

-----
HTH
Mr. B
askdoctoraccess dot com

"JK" wrote:

I guess I didn't provide enough information. The combo box is bound to table
(tblSaturdayDates) and the Criteria of the field in the query is Date()-14.

The form, where the combo resides, is a form used to enter sales activity
statistics. There are many sales reps and maybe ten or so fields in the form.
When a salesperson submits their activity summary report at the end of the
week, the stats from the excel spreadsheet get entered into the database.

So the admin entering the data has to first select (or enter) the
week-ending date and then the salesperson's statistics. To make things easier
for the admin, since the week-ending date is always a saturday, I decided to
create a table with all saturday dates. This way, the admin can easily select
the date. However, if a salesperson submits their activity summary report
three weeks or more late, the saturday date would not be available in the
comobo becasue of the criteria in the query. If I remove the criteria in the
query, then the admin would have to scroll through a long list to get to the
date the person is looking for.

If a user selects a date using the pop-up calendar and that date is not a
saturday date, I want the not in list event to fire and tell the admin that
it's not a saturday date. This is why I need it to work. If the user manually
enters a date in the combo and the date is not a saturday date the not in
list event fires as intended.

I hope this makes sense and clears things up. I just don't understand why
(or how) the pop-up calendar and circumvent the not in list event. Even if
it's not a saturday date I can still insert it and save the form without any
errors.

Thanks,
Jason

"AccessVandal via AccessMonster.com" wrote:

Show us the NotInList event code or did you have any?

JK wrote:
When I try to set a combo box to limit to list (a combo with all Saturday
dates) and then I click the popup calendar button and try to insert a date
that is not a saturday date, not a date that is in the table behind the combo
- it let's me.

Any idea how I can prevent this. I'm not sure why the limit to list feature
is ignored when entering a date using a popup calendar.

Thanks,
jason

--
Please Rate the posting if helps you.

Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...ccess/200904/1


  #9  
Old April 6th, 2009, 07:32 AM posted to microsoft.public.access
AccessVandal via AccessMonster.com
external usenet poster
 
Posts: 461
Default Limit to List Setting + Insert Date Using Popup Calendar

You can use the VB constant vbSaturday. (vbSunday start at 1)

Private Sub MyCombo_NotInList(NewData As String, Response As Integer)
Dim MyDate As Date, MyWeekDay As Integer
‘do a test
MyDate = #4/11/2009# ' Assign a date to a Saturday –US date.
‘assuming your control
‘MyDate = Me.MyCombo ‘assume date formated control or
‘MyDate = NewData
MyWeekDay = Weekday(MyDate) ' MyWeekDay contains 7 because
' MyDate represents a Saturday.
If MyWeekDay = vbSaturday Then
MsgBox MyWeekDay & " Which is on a Saturday"
Response = acDataErrAdded
Else
MsgBox "Not a saturday"
Response = acDataErrContinue
‘set focus back to control
Me.MyCombo.SetFocus
End If
End Sub


JK wrote:
If a user selects a date using the pop-up calendar and that date is not a
saturday date, I want the not in list event to fire and tell the admin that
it's not a saturday date. This is why I need it to work. If the user manually
enters a date in the combo and the date is not a saturday date the not in
list event fires as intended.

I hope this makes sense and clears things up. I just don't understand why
(or how) the pop-up calendar and circumvent the not in list event. Even if
it's not a saturday date I can still insert it and save the form without any
errors.

Thanks,
Jason


--
Please Rate the posting if helps you.

Message posted via http://www.accessmonster.com

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 06:00 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.