473,402 Members | 2,072 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,402 software developers and data experts.

MS Access form collects data on internet

I have an online form that users fill out and upon submission the data
goes to an MS access database on our server.

One of the fields asks for the date a student needs to take an exam.
The students know they should only use the online form if they are
scheduling at least 2 weekdays ahead of time, however, the form
doesn't currently have a way to reject a submission that breaks the 2
day rule.

Can anyone help me with a query where the data in the date field is
compared to the current date and accepted or rejected based on the
'Must schedule at least 2 WEEKDAYS ahead of time' rule?
Nov 12 '05 #1
3 3391
Tom
Mary,

Would you be better served in creating a Validation Rule for the date rather
than using a query to reject the date?

Request:
Could you give me the details of how to create an on-line form or where to look
for information on how to do it. Then I am particularly interested in the
details of how to get the data ito an Access database after it is submitted.

Thanks!

Tom
"Mary" <mo***@msn.com> wrote in message
news:cf*************************@posting.google.co m...
I have an online form that users fill out and upon submission the data
goes to an MS access database on our server.

One of the fields asks for the date a student needs to take an exam.
The students know they should only use the online form if they are
scheduling at least 2 weekdays ahead of time, however, the form
doesn't currently have a way to reject a submission that breaks the 2
day rule.

Can anyone help me with a query where the data in the date field is
compared to the current date and accepted or rejected based on the
'Must schedule at least 2 WEEKDAYS ahead of time' rule?

Nov 12 '05 #2
something you could try in your connect to Access ASP would be:

<%
...
d = Request.Form("Datefld")
If WeekDay(Date) = 6 Then 'Friday
If d > DateAdd("d", 4, Date) Then 'greater than Monday
Response.Write("Date entered is past the 2 day limit!")
Else
strConnect = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" &
Server.MapPath("\Students.mdb")
End If
End If
If WeekDay(Date)>= 2 Or WeekDay(Date)<=4 Then
If d > DateAdd("d",2,Date) Then
Response.Write("Date entered is past the 2 day limit!")
Else
strConnect = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" &
Server.MapPath("\Students.mdb")
End If
End If
...
%>

This isn't real sophisticated, but it is just to give you some ideas -
using If Then with Date Functions, if the submitter meets the criteria,
you write the data, if not, don't write the data.

Rich

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 12 '05 #3
mo***@msn.com (Mary) wrote in message news:<cf*************************@posting.google.c om>...
I have an online form that users fill out and upon submission the data
goes to an MS access database on our server.

One of the fields asks for the date a student needs to take an exam.
The students know they should only use the online form if they are
scheduling at least 2 weekdays ahead of time, however, the form
doesn't currently have a way to reject a submission that breaks the 2
day rule.

Can anyone help me with a query where the data in the date field is
compared to the current date and accepted or rejected based on the
'Must schedule at least 2 WEEKDAYS ahead of time' rule?


there's a weekday math function available at www.mvps.org/access

only problem is that you're going to have to rewrite that in VBScript
if you want it to work on your web page, because if you were doing it
on a form, you'd do it in the BeforeInsert event of the form, and
since you're talking directly to teh database engine, you wouldn't
have that event to help you. You'd have to modify the code for your
Submit button to do the checking for you and if it failed reject the
insertion... Something like
Sub cmdSubmit()
If WeekdayDiff(dtScheduleDate,dtCutoffDate)<2 Then
Response.Write("Sorry, need to workdays lead time!")
Else
'write the record to the database...
End if
End Sub
Nov 12 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: rob | last post by:
Hi to all. I am pretty new to using Access and am having a problem I hope someone can help me with. I want to access a MS-Access database from a web page. I have managed to get it "sort" of...
7
by: Kenneth_J | last post by:
Hey everyone, I just started doin some work with access and vba, and don't know much about it yet...any help would be much appreciated. My goal is to create a form in word that can be filled...
3
by: Bob | last post by:
All, I have read through lots of postings regarding my concerns, but I haven't found what I am looking for. The center (non profit University) where I work collects scientific data about...
6
by: John | last post by:
Hi We have an access app (front-end+backend) running on the company network. I am trying to setup replication for laptop users who go into field and need the data synched between their laptops...
3
by: Lyle Fairfield | last post by:
In a recent thread there has been discussion about Data Access Pages. It has been suggested that they are not permitted on many or most secure sites. Perhaps, that it is so, although I know of no...
15
by: Cheryl Langdon | last post by:
Hello everyone, This is my first attempt at getting help in this manner. Please forgive me if this is an inappropriate request. I suddenly find myself in urgent need of instruction on how to...
9
by: Wayne Smith | last post by:
I've come up against a major headache that I can't seem to find a solution for but I'm sure there must be a workaround and I would really be grateful of any help. I'm currently building a web...
1
by: Michael | last post by:
Hello, I am trying to develop a database solution for an organisation in Indonesia. This organization has a number of offices and users throughout the country. They all need to maintain their...
2
by: gcdevelopment | last post by:
Well, i have set up a website that collects someone's blog on Blogger.com The blog however requires one to be invited by a user in order to view it. I have been invited and i accepted it. When i...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.