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

Default Value from a Lookup Table

I want to set a default value in a table called "Quotes" for a field
called "Source."

The "Source" field uses a lookup table called "Source" which looks
like this:

Sourceabbrev Sourcename
BX-MI BUILDERS EXCHANGE MI
BX-OH BUILDERS EXCHANGE OH
CNS-MI CONSTRUCTION NEWS SERVICE MI
DODGE-MI DODGE MI
OTHER OTHER
I want the default to be "OTHER". What do I need to enter in the
"Quotes" "Source" default value line to get this to happen?

I need the exact syntax since I've tried several things and keep
getting syntax or other errors.

Thanks,
Tina

Jun 13 '07 #1
4 6616
Hi

Unless I've misunderstood you should just be able to enter "OTHERS" as
the default value

Thanks
James

http://www.jamesoleary.co.uk/

On 13 Jun, 15:52, TinaF <tferr...@uiscorp.comwrote:
I want to set a default value in a table called "Quotes" for a field
called "Source."

The "Source" field uses a lookup table called "Source" which looks
like this:

Sourceabbrev Sourcename
BX-MI BUILDERS EXCHANGE MI
BX-OH BUILDERS EXCHANGE OH
CNS-MI CONSTRUCTION NEWS SERVICE MI
DODGE-MI DODGE MI
OTHER OTHER

I want the default to be "OTHER". What do I need to enter in the
"Quotes" "Source" default value line to get this to happen?

I need the exact syntax since I've tried several things and keep
getting syntax or other errors.

Thanks,
Tina

Jun 13 '07 #2
On Jun 13, 9:57 am, James <james_no_spam_ple...@yahoo.co.ukwrote:
Hi

Unless I've misunderstood you should just be able to enter "OTHERS" as
the default value

Thanks
James

http://www.jamesoleary.co.uk/

On 13 Jun, 15:52, TinaF <tferr...@uiscorp.comwrote:
I want to set a default value in a table called "Quotes" for a field
called "Source."
The "Source" field uses a lookup table called "Source" which looks
like this:
Sourceabbrev Sourcename
BX-MI BUILDERS EXCHANGE MI
BX-OH BUILDERS EXCHANGE OH
CNS-MI CONSTRUCTION NEWS SERVICE MI
DODGE-MI DODGE MI
OTHER OTHER
I want the default to be "OTHER". What do I need to enter in the
"Quotes" "Source" default value line to get this to happen?
I need the exact syntax since I've tried several things and keep
getting syntax or other errors.
Thanks,
Tina
I can't do that because the data type is set to Number. So I'm
assuming it uses the row number. I did not set up this database,
someone else did before I worked here.

Jun 13 '07 #3
TinaF wrote:
On Jun 13, 9:57 am, James <james_no_spam_ple...@yahoo.co.ukwrote:
>>Hi

Unless I've misunderstood you should just be able to enter "OTHERS" as
the default value

Thanks
James

http://www.jamesoleary.co.uk/

On 13 Jun, 15:52, TinaF <tferr...@uiscorp.comwrote:

>>>I want to set a default value in a table called "Quotes" for a field
called "Source."
>>>The "Source" field uses a lookup table called "Source" which looks
like this:
>>>Sourceabbrev Sourcename
BX-MI BUILDERS EXCHANGE MI
BX-OH BUILDERS EXCHANGE OH
CNS-MI CONSTRUCTION NEWS SERVICE MI
DODGE-MI DODGE MI
OTHER OTHER
>>>I want the default to be "OTHER". What do I need to enter in the
"Quotes" "Source" default value line to get this to happen?
>>>I need the exact syntax since I've tried several things and keep
getting syntax or other errors.
>>>Thanks,
Tina


I can't do that because the data type is set to Number. So I'm
assuming it uses the row number. I did not set up this database,
someone else did before I worked here.
Are you saying that the Source field in table Quotes is numeric? And
the SourceTable has no numeric or autonumber fields in it? That seems odd.

Well, if it's using numbers then, look for a quote record with the
Source = Other. I suppose that would be a 4 based on the record list of
the source table you provide. Try 1,2, or 3 if that doesn't work.

I suppose if that's the way it's done you can find some code that
converts the numbers to text and visa versa. Seems like a bunch of work
when one could have used a lookup table. Or perhaps it is using a combo
box to select and the rowsource type (open property sheet of combo,
click Data tab) is ValueList instead of Table/Query. If so, determine
the number associated to the value list.

Jun 13 '07 #4
On Jun 13, 10:57 am, James <james_no_spam_ple...@yahoo.co.ukwrote:
Hi

Unless I've misunderstood you should just be able to enter "OTHERS" as
the default value

Thanks
James

http://www.jamesoleary.co.uk/

On 13 Jun, 15:52, TinaF <tferr...@uiscorp.comwrote:
I want to set a default value in a table called "Quotes" for a field
called "Source."
The "Source" field uses a lookup table called "Source" which looks
like this:
Sourceabbrev Sourcename
BX-MI BUILDERS EXCHANGE MI
BX-OH BUILDERS EXCHANGE OH
CNS-MI CONSTRUCTION NEWS SERVICE MI
DODGE-MI DODGE MI
OTHER OTHER
I want the default to be "OTHER". What do I need to enter in the
"Quotes" "Source" default value line to get this to happen?
I need the exact syntax since I've tried several things and keep
getting syntax or other errors.
Thanks,
Tina- Hide quoted text -

- Show quoted text -
You need to set an autonumber (random) primary key in the Source table
and call it SourceID. Then in the Quote table (table names should be
singular ergo Quote would be the name to use for this table not
Quotes) set the default value of the Status field to the value of the
SourceID for the "Other" source in the Source table. You should
actually change the field name in the Quote table to SourceID since
that is what it stores and not the actual Source name. Welcome to
the world of relational databases. While you are at it set yoru
relationships!
Jun 13 '07 #5

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

Similar topics

1
by: Sophie Bradshaw | last post by:
i was wondering if anyone could possibly help me! i have a ms access database, and in one of the tables, one of the fields is a lookup column, with several possible values. what i want to do is...
2
by: Todd D. Levy | last post by:
I have a table of Country names & Country codes in alphabetical order. This is a lookup table that a number of other tables use to populate the Country field via a drop down Combo Box on the...
3
by: my-wings | last post by:
I've been reading about how evil Lookup fields in tables are, but I've got to be missing something really basic. I know this subject has been covered before, because I've just spent an hour or two...
1
by: Dan | last post by:
I am using an expression in Forms to take several fields of data and convert them to a block of text. For one of the fields set-up as a combo box, it is based on a Lookup of a separate table to...
1
by: jhicsupt via AccessMonster.com | last post by:
Bear with me – a long question but hopefully someone can help me. I have a survey which uses weighting to get the final score. I’m trying to find the best way to calculate the final score. I...
0
by: northshore | last post by:
Hello, I am creating a windows application database. I have a primary table 'Individuals' and a lookup table 'Prefixes.' In the Individuals table, I have a column 'PrefixID' that references...
5
by: sensreview | last post by:
Hello, I need help in selecting a value from combo list thru one lookup table and update different table on MS access form. For eg; I have a lookup table of usernames, I need to use this...
1
by: whitbacon | last post by:
I would like to have the ability to archive values in a lookup table. Take the following example lookup table luid, label, archive 1, green, No 2, red, No 3, blue, No select * from...
6
by: David Wright | last post by:
Hello Folks I am using Microsoft Access 2000 I would be grateful if someone could help me with “Dlookup”. I tried various methods of writing Dlookup and various events to trigger it, none of...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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,...

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.