Basically i have a booking system and on certain days i need to allow an "extension", to do this i am using a yes/no and a check box. I need to creat a validation rule so that the box is only tickable if my Event_date field is a friday or saturday.
Do i need to use something like Weekday(Date()) = ?
I am a doctor working in Sri lanka wanting to use access to make our clinic work faster. Only fields required are clinic number (Unique), patient name and last clinic date. What i want is
1. In the form when i enter the clinic number the name should come up where i need to confirm to proceed.
2. Once a patient has come to the clinic that clinic number cannot be entered till 4 weeks are past!
I tried and tried to write macros or vb...(i'm a novice in these) but failed. This looks simple though. Can anyone help? any suggestion welcome.
ps:- this is a charity work. i'm not earning money from making this database!
I have code in a BeforeUpdate subroutine of a text box to validate the date. The user can choose to keep or discard the value but the warning only appears if the date is in the future or at least a month old. This is my code: Private Sub txtDate_BeforeUpdate(Cancel As Integer) Dim dtCurrent As Date Dim objResult As VbMsgBoxResult
If (Trim(txtDate) = "" Or IsNull(txtDate)) Then Exit Sub End If
objResult = vbYes dtCurrent = CDate(txtDate)
If (dtCurrent > DateTime.Date) Then objResult = MsgBox("This date is in the future. Are you sure you wish to leave this value?", vbYesNo, "Warning") ElseIf (DateDiff("m", dtCurrent, DateTime.Date) > 1) Then objResult = MsgBox("This date is at least one month old. Are you sure you wish to leave this value?", vbYesNo, "Warning") End If
If (objResult = vbNo) Then Cancel = True End If
End Sub It works fine when I answer "Yes" but if I hit "No" I get this message: The value in the field or record violates the validation rule for the record or field. This control doesn't have a validation rule. In fact, there are no validation rules in any of the controls on this form nor on any of the attributes in the control source (table). The date is a required attribute of the table though. I can't hide this extra error message by turning off warnings because it happens after I exit the subroutine, so I wouldn't be able to turn the warnings back on. I also can't trap this error because it occurs after the subroutine ends.
If possible I would want the text box to be cleared and be focused if the user selects "No" to discard the date.
I have a date field in a table which is Short Date with an input mask of 99/00/000;0;_
I do not want (for reasons too complicated to go into here) to put this as a required field even though it is a required field (makes sense from my end!).
If I set Required Field to "No" what format can I put in the validation rule field so a message (from my validation text field) comes up if the field is left blank??
I have a table that has entries recorded with date and time in one field, and I want to have a query that returns all records of a specified date or date range, regardless of the time in the field.
I have tried
Code: Between [StartDate:] And [EndDate:]
And
Code: Between [StartDate:] & "00:00" And [EndDate:] & "23:59"
I'm trying to get my "IncidentDate" field to autopopulate two other date fields to a few days from the "IncidentDate". The other two date fields are "ContainDueDate" and "RootDueDate". I'm trying to accomplish this on my "Test CAP Form"
I tried using the following in the BeforeUpdate of "ContainDueDate" and received a complier error: expected =
Code : DateAdd(d,2,[IncidentDate])
so I removed the parenthesis and nothing happened
Code : DateAdd d,2,[IncidentDate]
I even tried redoing it in the AfterUpdate of "IncidentDate" and nothing happened either
Code : DateAdd d,2,[ContainDueDate]
I'm not sure if I'm even using the right function to get what I want.
I have a problem. I want my field to become "[field], An " etc. when I type "An [field]" For example, if I type "The Hundred Years War" for the field, it automatically updates to "Hundred Years War, The". I would be happy with a simple validation rule that prohibits the use of "The, A or An" in the beginning of the field but i don't think that is posibble. If this requires VB, I don't know how to use the language and never worked with it. I am completely a novice in VB, but would still love to learn how to make it. :) If you could start me out then, I would appreciate it greatly. :D
Hi im new round here but am working on a database and sum of the validation rules are confusing me now.
Ok i got a couple of things to ask:
1) What rule do i use to make sure only text is entered into the field, i cant use input masks as the size of the text put into the field will vary, as its names of people.
2) Is there a way to check that all the fields on a form have been entered? So if there not all entered an error appears?
3) Finally, is there a way to reset Autonumbers? or do i have to delete all the records and start frm scratch as my autonumbers have gone abiit crazy as sum records have been deleted so my table looks rather strange.
I want to have a validation which will only allow confirmed to be clicked when paid is selected. I put this validation "Confirmed"<"Paid" in the properties part of the table but it doesnt work.
For my Year 12 Computing course, I need to develop a database which will take bookings for a village hall. The database consists of a Bookings Table, a Customer Data Table and a Hiring Cost Table. It is in the Bookings Table that I am having the most trouble.
I believe I have already solved my double booking dilemma by making the Date of Event and Type of Event fields in the Bookings Table into a composite key, thereby prohibiting the entering of data where Date of Event and Type of Event are the same, making them unique.
Here is my main problem at the moment, I need a validation rule on the Date of Event or perhaps the Date of Booking field which means a booking must be made at least a week, and no more than two months in advance of the date of event. The thing is this validation rule is only needed for occasional bookings. Present, again on the bookings table is a Booking Type field which has a lookup consisting of the following “Regular” and “Occasional”, regular meaning bookings that are made at the start of the year, for the whole year.
Ideally, I would like to have it so that when the booking type field is set to regular, the validation rule for the date isn’t needed, and when the booking type field is set to occasional, the validation rule for the date is needed/present.
Could anyone help me with this? As any help would be much appreciated.
Many thanks Daniel
If anyone would like any screenshots of the Bookings Table, email me at daniel_goodman@hotmail.com
How can I set validation for a text field where I restrict the number of characters? For example, if I only want the user to be able to input 12 characters or less, and more than one. >=1 And <=12 would that be correct?
Hi all, Very new to using ACCESS. I am trying to set a validation criteria to ensure that a postcode is imported correctly. An example of a UK post code is SP10 3PB - it may be entered as SP103PB. I need to set a validation criteria to allow either two. What is the format of the criteria to achieve this? Any clues please. Thanks Mike
Are there any useful sites that set out examples of validation criteria?