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 » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

A very little problem!



 
 
Thread Tools Display Modes
  #1  
Old August 28th, 2006, 10:15 AM posted to microsoft.public.access.forms
hanski
external usenet poster
 
Posts: 8
Default A very little problem!

Hi

I have in my Access one row in sql language.

"select * from Dbase1, Dbase2 where Dbase2.Fieldname = true"

I would field called Name both in Dbase1 and Dbase2. In Dbase2 I have
in Fieldname field either true (-1) or false(0). In case Fieldname =
true I would like to involve such fields into my query from Dbase1. The
problem is that it gives me error "Invalid column name 'true' ".
How can I change my code, so it would acceptable?

Hannu

  #2  
Old August 28th, 2006, 03:33 PM posted to microsoft.public.access.forms
ManningFan
external usenet poster
 
Posts: 157
Default A very little problem!

NEVER use fields called "Name", "True", False", "Date", "OR" or
anything else Access sees as a reserved word. Call it "True1" or
something.

hanski wrote:
Hi

I have in my Access one row in sql language.

"select * from Dbase1, Dbase2 where Dbase2.Fieldname = true"

I would field called Name both in Dbase1 and Dbase2. In Dbase2 I have
in Fieldname field either true (-1) or false(0). In case Fieldname =
true I would like to involve such fields into my query from Dbase1. The
problem is that it gives me error "Invalid column name 'true' ".
How can I change my code, so it would acceptable?

Hannu


  #3  
Old August 28th, 2006, 04:45 PM posted to microsoft.public.access.forms
John Vinson
external usenet poster
 
Posts: 4,033
Default A very little problem!

On 28 Aug 2006 02:15:15 -0700, "hanski"
wrote:

Hi

I have in my Access one row in sql language.

"select * from Dbase1, Dbase2 where Dbase2.Fieldname = true"


Since you don't have any JOIN expression in this query, you will
retrieve every record in DBase1, paired with every record in DBase2
which fits the criterion. Probably not what you want!

I would field called Name both in Dbase1 and Dbase2.


As ManningFan says, this is a Bad Idea. I don't think it's causing
this particular problem but it might.

In Dbase2 I have
in Fieldname field either true (-1) or false(0). In case Fieldname =
true I would like to involve such fields into my query from Dbase1. The
problem is that it gives me error "Invalid column name 'true' ".
How can I change my code, so it would acceptable?


Please copy and paste the *actual* SQL of the query, or the context of
the VBA code in which you're setting up the query. I cannot see how
the SQL statement above would generate this particular error. It might
help to also know the field definitions, Primary Key, and
relationships between your tables.

John W. Vinson[MVP]
 




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 04:23 PM.


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