A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Database Design
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

IIF SELECT in Row Source



 
 
Thread Tools Display Modes
  #1  
Old July 31st, 2008, 05:07 PM posted to microsoft.public.access.tablesdbdesign
ridgerunner
external usenet poster
 
Posts: 118
Default IIF SELECT in Row Source

I sent a question about this earlier but since it has not shown up, I am
sending a shorter version. I have a field in my database that is a combo box
and the SELECT statement in the row source looks up a value in another table.
Is it possible for the row source to contain a statement that will cause the
lookup to look in another table based on a certain value in another field?

Your help is greatly appreciated,
ridgerunner
  #2  
Old July 31st, 2008, 05:34 PM posted to microsoft.public.access.tablesdbdesign
bhicks11 via AccessMonster.com
external usenet poster
 
Posts: 529
Default IIF SELECT in Row Source

Are you talking about a third table? Maybe if you show what query you have
tried we can see what you are looking for?

Bonnie
http://www.dataplus-svc.com

ridgerunner wrote:
I sent a question about this earlier but since it has not shown up, I am
sending a shorter version. I have a field in my database that is a combo box
and the SELECT statement in the row source looks up a value in another table.
Is it possible for the row source to contain a statement that will cause the
lookup to look in another table based on a certain value in another field?

Your help is greatly appreciated,
ridgerunner


--
Message posted via http://www.accessmonster.com

  #3  
Old July 31st, 2008, 05:50 PM posted to microsoft.public.access.tablesdbdesign
ridgerunner
external usenet poster
 
Posts: 118
Default IIF SELECT in Row Source

I now have two tables of similar questions that have the same question ID. I
tried the below statement in the row source of the QstID field but the result
is you only see the Question ID number.

SELECT IIF(tblQuestions.StoreNo=50, tblQuestions.QstID,
tblQuestions.QstWithPtVal FROM tblQuestions ORDER BY tblQuestions.QstSortOrd,
tblCWQuestions.QstID, tblCWQuestions.QstWithPtVal FROM tblCWQuestions ORDER
BY tblCWQuestions.QstSortOrd);

"bhicks11 via AccessMonster.com" wrote:

Are you talking about a third table? Maybe if you show what query you have
tried we can see what you are looking for?

Bonnie
http://www.dataplus-svc.com

ridgerunner wrote:
I sent a question about this earlier but since it has not shown up, I am
sending a shorter version. I have a field in my database that is a combo box
and the SELECT statement in the row source looks up a value in another table.
Is it possible for the row source to contain a statement that will cause the
lookup to look in another table based on a certain value in another field?

Your help is greatly appreciated,
ridgerunner


--
Message posted via http://www.accessmonster.com


  #4  
Old July 31st, 2008, 07:35 PM posted to microsoft.public.access.tablesdbdesign
Jeff Boyce
external usenet poster
 
Posts: 8,621
Default IIF SELECT in Row Source

If I understand your description correctly, you are using a "lookup field"
in your table. You'll find a lot of (negative) comments in this newsgroup
about using lookup fields. Not only do they cause considerable confusion
(?do you query on the underlying ID value or on the
"displayed-but-not-actually-stored" value?), they encourage you and your
users to work directly in the tables.

Access tables store data (they are "buckets o' data") but are not
particularly capable when it comes to display.

Access forms display data (from queries/from tables), and are exceptional at
helping you manage how users interact with the data.

You can create a combobox in a form that does the same kind of looking up
(for the form) without any (or much) of the confusion from trying to get the
table to do something it isn't designed to do.

Regards

Jeff Boyce
Microsoft Office/Access MVP

"ridgerunner" wrote in message
...
I sent a question about this earlier but since it has not shown up, I am
sending a shorter version. I have a field in my database that is a combo
box
and the SELECT statement in the row source looks up a value in another
table.
Is it possible for the row source to contain a statement that will cause
the
lookup to look in another table based on a certain value in another field?

Your help is greatly appreciated,
ridgerunner



  #5  
Old July 31st, 2008, 07:51 PM posted to microsoft.public.access.tablesdbdesign
ridgerunner
external usenet poster
 
Posts: 118
Default IIF SELECT in Row Source

Thanks Jeff. This morning I read a lot about the evils of lookups in a
database. I previously decided to use them after reading about them in John
L. Viescas book, "Access 2033 Inside and Out". They worked great up to this
point and I am too deep into my project to change now, but I have had a
painful lesson. I am working around the issue by creating forms and reports
that point to the second table of questions (a few of the questions vary
only by a small amount in the wording for only one store). I could try to
change the combo box in the database but I have many queries, forms and
reports and it isn't worth risking blowing everything up at this point. I
guess famous last words are "be sure everything is the same for all".
ridgerunner

"Jeff Boyce" wrote:

If I understand your description correctly, you are using a "lookup field"
in your table. You'll find a lot of (negative) comments in this newsgroup
about using lookup fields. Not only do they cause considerable confusion
(?do you query on the underlying ID value or on the
"displayed-but-not-actually-stored" value?), they encourage you and your
users to work directly in the tables.

Access tables store data (they are "buckets o' data") but are not
particularly capable when it comes to display.

Access forms display data (from queries/from tables), and are exceptional at
helping you manage how users interact with the data.

You can create a combobox in a form that does the same kind of looking up
(for the form) without any (or much) of the confusion from trying to get the
table to do something it isn't designed to do.

Regards

Jeff Boyce
Microsoft Office/Access MVP

"ridgerunner" wrote in message
...
I sent a question about this earlier but since it has not shown up, I am
sending a shorter version. I have a field in my database that is a combo
box
and the SELECT statement in the row source looks up a value in another
table.
Is it possible for the row source to contain a statement that will cause
the
lookup to look in another table based on a certain value in another field?

Your help is greatly appreciated,
ridgerunner




  #6  
Old July 31st, 2008, 10:42 PM posted to microsoft.public.access.tablesdbdesign
Jeff Boyce
external usenet poster
 
Posts: 8,621
Default IIF SELECT in Row Source

I wish you (and whoever "gets" to maintain your database in the future) all
the best ... and if you happen to be the one to return to do some work on it
in 6 months or a year, I hope you remember that "what you see is NOT what
you get" when you work in those tables.

Although it might be a painful lesson, I suspect this falls into the "pay
now or pay later" category...

Good luck!

Regards

Jeff Boyce
Microsoft Office/Access MVP


"ridgerunner" wrote in message
...
Thanks Jeff. This morning I read a lot about the evils of lookups in a
database. I previously decided to use them after reading about them in
John
L. Viescas book, "Access 2033 Inside and Out". They worked great up to
this
point and I am too deep into my project to change now, but I have had a
painful lesson. I am working around the issue by creating forms and
reports
that point to the second table of questions (a few of the questions vary
only by a small amount in the wording for only one store). I could try to
change the combo box in the database but I have many queries, forms and
reports and it isn't worth risking blowing everything up at this point. I
guess famous last words are "be sure everything is the same for all".
ridgerunner

"Jeff Boyce" wrote:

If I understand your description correctly, you are using a "lookup
field"
in your table. You'll find a lot of (negative) comments in this
newsgroup
about using lookup fields. Not only do they cause considerable confusion
(?do you query on the underlying ID value or on the
"displayed-but-not-actually-stored" value?), they encourage you and your
users to work directly in the tables.

Access tables store data (they are "buckets o' data") but are not
particularly capable when it comes to display.

Access forms display data (from queries/from tables), and are exceptional
at
helping you manage how users interact with the data.

You can create a combobox in a form that does the same kind of looking up
(for the form) without any (or much) of the confusion from trying to get
the
table to do something it isn't designed to do.

Regards

Jeff Boyce
Microsoft Office/Access MVP

"ridgerunner" wrote in message
...
I sent a question about this earlier but since it has not shown up, I am
sending a shorter version. I have a field in my database that is a
combo
box
and the SELECT statement in the row source looks up a value in another
table.
Is it possible for the row source to contain a statement that will
cause
the
lookup to look in another table based on a certain value in another
field?

Your help is greatly appreciated,
ridgerunner






 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 05:45 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.