473,378 Members | 1,360 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,378 software developers and data experts.

Access expressions

2
Hi everyone,
I am just starting with the Access and I was wondering, if someone could help me:

I created a few boxes in the database, but I dont know how to build expressions to get a default value for them:

1. One of those boxes is called "sex" and what I am trying to do, is to set up a default value for it, so it will fill out automatically with:
"F" when the "title" is "Miss" or "Mrs" or "Miss" and
"M" when the "title" is "Mr"

2. Another one would be "age group" with subcategories filled out automatically:
16-19
20-25
26-35
26-45
45+
(I have already created a field "age" with a current age of the client, so that box "agegroup" would depend on this one.

3. Then "postcode" field, that would 'cut off' the second part of the original postcode (uk postcodes i.e. eh13 4ed), so that I can have them grouped in a report.


I hope that I haven't complicated it too much!!

Thanks
Gosha
Sep 5 '08 #1
2 1250
gosha
2
I found and answer for the first one....
Could anyone please help me with the secon one??

=IIf([Age]= Between "16" And "19", "16-19" Or [Age]= Between "20" And "25", "20-25" Or [Age]= Between "26" And "35", "26-35" Or [Age]= Between "36" And "45", "36-45" , "45+")

??? i think its too many value there.........?>>>>
Sep 5 '08 #2
NeoPa
32,556 Expert Mod 16PB
You don't paint a very clear picture I'm afraid of what you're trying to do.

Assuming you are looking at coding a query from a table where [Age] is a field :
Expand|Select|Wrap|Line Numbers
  1. SELECT [Age],
  2.        Switch([Age]<20,'16-19',[Age]<26,'20-25',[Age]<36,'26-35',[Age]<46,'36-45',TRUE,'46+'),
  3.        ...
  4.  
  5. FROM [YourTable]
Sep 6 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Terry Bell | last post by:
I'm upsizing an Access database. Got the data converted, working on the front end, converting queries to views, but having trouble converting queries that use logical expressions like the...
3
by: MrPhil | last post by:
I've installed SP8. Why does ACCW2K3 insist on reminding me, upon attempting to open an MDB: 1: that unsafe expressions are not blocked (I don't care; this is an internal protected app); 2: that...
2
by: edo | last post by:
100 Day Analysis Following is a summary of articles spanning a 100 day period, beginning at 10 Sep 2003 06:41:30 GMT and ending at 19 Dec 2003 04:09:06 GMT. Notes ===== - A line in the...
6
by: Peter Frost | last post by:
Please help I don't know if this is possible but what I would really like to do is to use On Error Goto to capture the code that is being executed when an error occurs. Any help would be much...
1
by: Suzi Carr | last post by:
Hello, We create querydefs in VB programs (i.e. CreateQueryDef). But as illustrated below, Access regenerates the SQL code we specify -- particularly the WHERE clause. While the new code is...
5
by: kathyk | last post by:
Hi All, We are moving to Access 2003 in a month or so, so i started testing my data base files in v2003. When The mdb open I get 3 warning messagase about blocking unsafe expressions. Security...
24
by: cassetti | last post by:
Here's the issue: I have roughly 20 MS excel spreadsheets, each row contains a record. These records were hand entered by people in call centers. The problem is, there can and are duplicate...
23
by: Reggie | last post by:
Hi and TIA. I developed several A2K dbs which are now being run on my clients computer which have been upgraded to Access 03. I'm not sure exactly what they mean but of you know or could point me...
8
by: Darryl Kerkeslager | last post by:
Currently I am using the RegExp object to parse a large dataset in an Access table - but this table was exported from SQL Server, and the very correct question was asked - why not just do it in SQL...
49
by: Allen Browne | last post by:
If you are looking for opinon on what's useful in Access 2007, there's a new article at: http://allenbrowne.com/Access2007.html Covers what's good (useful features), what's mixed (good and bad),...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...

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.