Jump to content

Help appreciated with forms and queries in Access

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
4 replies to this topic

#1
alexbabwa

alexbabwa

    Newbie

  • Members
  • Pip
  • 6 posts
Hey people :) i have a database due in on the 26th for my final year and i am struggling. Our lecturer can't even work out how to do half of these tasks which is frustrating (i mean why are we paying tuition if hes not going to teach us how to program SQL or VB). So im entirely dependant on online tutorials and my Access for dummies book. They are usefull unfortunately they only get me so far. If you can offer any help with any of these problems i would be more than grateful, i can't imagine what motivates nice programmers to help out newbs.

First problem is this, i made a table, i made a form. In this form is a text box. This text box stores date of birth. I want to create a query that will give me a list with birthdays 7 days in advance of the current date. I have been messing around with datediff lately but no joy.

Second problem is how to ensure the birth dates entered are sensible(eg before the year 2005).

The third problem is how to reject the entry if no surname is entered. The null facility is one thing, but how to reject the entry of a form itself with no surname is beyond me.

Again if you have made it this far through my post, thank you for taking the time to read it.

Database version Access 2003

#2
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
I'm sorry. Anyone who is spending serious time on Access as if it were a "real" database has done you a disservice. Have you done any VBA?
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

#3
alexbabwa

alexbabwa

    Newbie

  • Members
  • Pip
  • 6 posts
Not really no. All we have been given to aid us is a pretty blue book with some basic SQL statements such as WHERE, FROM, SELECT, DISTINCT etc The lecturer knows about these, but as i said before his knowledge of SQL is limited.

#4
alexbabwa

alexbabwa

    Newbie

  • Members
  • Pip
  • 6 posts
Eek, still no joy

#5
Arctic Fire

Arctic Fire

    Learning Programmer

  • Members
  • PipPipPip
  • 48 posts
For your first problem, this should do it.

SELECT * FROM People WHERE (DatePart("y",People.bday) - DatePart("y",Date())) BETWEEN 0 AND 7;

I think that'll get you on the right track with the second problem, too. ;)

http://www.techonthe...te/datepart.php