|
|
How do I setup a date field property that allows only Saturdays?
For example:
03/13/2010 would be fine, as that is a Saturday. 03/12/2010 would return an
error message as it is a Friday.
How would I create a field property for this, or would I use a different
aspect of Access creation?
|
|
0
|
|
|
|
Reply
|
Utf
|
3/12/2010 2:44:01 AM |
|
jaymalea wrote:
>For example:
>
>03/13/2010 would be fine, as that is a Saturday. 03/12/2010 would return an
>error message as it is a Friday.
>
>How would I create a field property for this, or would I use a different
>aspect of Access creation?
Private Sub txtSaturday_BeforeUpdate(Cancel As Integer)
If Not Weekday(Me.txtSaturday) = vbSaturday Then
MsgBox "Not a Saturday!"
Cancel = True
End If
End Sub
--
Message posted via http://www.accessmonster.com
|
|
0
|
|
|
|
Reply
|
PieterLinden
|
3/12/2010 3:17:07 AM
|
|
Open the table in design view, select the Date/Time field, and set these
properties:
- Validation Rule: ([SatOnly] Mod 7)=0
- Validation Text: Must be a Saturday
Replace the SatOnly with the name of your field.
--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
"jaymalea" <jaymalea@discussions.microsoft.com> wrote in message
news:A0A534FE-E315-4E60-979C-35BBF20B21F2@microsoft.com...
> For example:
>
> 03/13/2010 would be fine, as that is a Saturday. 03/12/2010 would return
> an
> error message as it is a Friday.
>
> How would I create a field property for this, or would I use a different
> aspect of Access creation?
|
|
0
|
|
|
|
Reply
|
Allen
|
3/12/2010 5:52:08 AM
|
|
On Thu, 11 Mar 2010 18:44:01 -0800, jaymalea
<jaymalea@discussions.microsoft.com> wrote:
>For example:
>
>03/13/2010 would be fine, as that is a Saturday. 03/12/2010 would return an
>error message as it is a Friday.
>
>How would I create a field property for this, or would I use a different
>aspect of Access creation?
Might it not be better to have the textbox just adjust itself to the next (or
previous) Saturday instead? You can use DateAdd() in the textbox's afterupdate
event to reset the date:
Private Sub txtSaturday_AfterUpdate()
If Weekday(Me!txtSaturday) <> vbSaturday Then
Me!txtSaturday = DateAdd("d", 7 - Weekday(Me!txtSaturday))
MsgBox "Adjusted date to Saturday, " & format(Me!txtSaturday, "dd-mmm-yyyy")
End If
End Sub
--
John W. Vinson [MVP]
|
|
0
|
|
|
|
Reply
|
John
|
3/12/2010 6:24:50 AM
|
|
|
3 Replies
234 Views
(page loaded in 0.133 seconds)
Similiar Articles: How do I setup a date field property that allows only Saturdays ...Create a validation rule to validate data in a field - Access ... For example, a Date/Time field accepts only dates and times, a Currency ... the data in the control ... how do I remove the date the document was printed - microsoft ...How do I remove the date from the document that ... If this field is printing on the ... do I turn off the extra document property page printed after ... How do I ... calculating incremental value contingent on other field ...Also - how do I concatenate field contents (e.g to ... using dmax and date field - microsoft ... field calculator dialog box allows for calculating the values of a field by ... Displaying value of a variable on a form - microsoft.public.access ...... boxes, each box is for a date ... has a "cancel" option, and allows you to 'test' conditions of controls and do ... for code setup, and form setup of values..it is ONLY for ... What is common practice? - microsoft.public.access.formscoding ...... typically a Text (255) field, so you must validate if it is to store a date or ... can call it bring the properties up to date ... really. but the most common setup i ... Depreciation Schedule - microsoft.public.access.queries ...It would have a column for the date and for the ... Access forms only allow to bind them with tables (while the ... P946.xml How To Fileid: PAGER/XML Depreciate Property ... Setting checkbox value in subform - microsoft.public.access ...... Yeah, but subforms don't allow ... to make a checkbox for every date it shows ... Set value of a field ... Other properties can be set only when a ... can also move ... Can I group by year or month(when message received)in my inbox ...Can I do this by year or month, or I can only do this with the exact date+time. ... ReceivedDate property, but you can't group or sort by such a field. The only ... XML vs SQL Server - microsoft.public.dotnet.languages.csharp ...Most of them only 10 or 20 KB. The functionality I ... RETURN VARCHAR2; FUNCTION stringify(p_field IN DATE ... > > You're already setup to do this, because you can override ... Appearance of a tab control label - microsoft.public.access ...... Version: 12.0.6413.0 File date: Date ... Dynamic Label Control Property in 2008 - microsoft.public ... Publisher not type, will only allow me to open and print ... How do I setup a date field property that allows only Saturdays ...Create a validation rule to validate data in a field - Access ... For example, a Date/Time field accepts only dates and times, a Currency ... the data in the control ... Control data entry formats with input masks - Access - Office.comUnder Field Properties, on the General tab, click the ... you plan on using the Date Picker on a Date/Time field? If you do ... Allows you to substitute the last four digits ... Configure User and Resource Mailbox Properties: Exchange 2010 HelpModified This read-only field displays the last date ... and use the corresponding property page to configure ... Allow scheduling only during working hours ... Configure Mailbox Database Properties: Exchange 2010 Help... its own properties that you can configure. These properties ... Last full backup This read-only field displays the date ... Select this check box to allow the ... DateTimeControl Control « Karine Bosch’s BlogHow can i allow the user to enter only Date and make it as a required field. ... Try changing date properties at pre render ... Configure your SharePoint Server for ... 7/22/2012 9:17:47 AM
|
|
|
|
|
|
|
|
|