so what have you learned from the exercise?
you have to be careful when referring to things named by you
initially you refer to servicedate, all one word, yet later your final solution you refer to [service date]
you have to use the square brackets if you use a space between words in a table or column name. its a nasty little thing, that access does in letting people use spaces in column names. it takes you further away from the SQL standard. its also totally uneccesary as you can set the 'caption property on the column when designing the table for a human readable value.
so there's a consistency issue
either separate words in column or table names with an underscore or capitalisation
eg
service_date
or ServiceDate
you can help yourself with consistency by either adding option explicit to the front of every vba (form, report or code) module or tick the box in the options forcing Access to do this for you. thats only an option in more recent versions of Access, and not the one I have access to here so forget the wording.
string literals in a where clause must be encapsualted by a ' or "
numeric literals don't
date literals should be encapsulated by # and be in ISO (yyyy mm dd) or US (mm dd yyyy)
usually there's a reason why references are quoted in answers. often you will get a better solution if you treat responses here as suggestions but go and check the suggestions in the helpfile or google it. people make suggestions but often thise suggestions are from fallable memory, so treat 'em as suggested ways of solving the problem but check the detail elsewhere if you are struggling with it.
Quote:
Once again this forum has been great.
My profilic thanks to healdem and sinndho for your help
|
thats what we and dbforums are here for