Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Queries / August 2006

Tip: Looking for answers? Try searching our database.

SQL problem

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jack - 07 Aug 2006 22:50 GMT
Hi

Can someone help me with the following problem:

SQLValid = "Select * from [Item Master] where [part #] = '" _
& [Forms]![Actual Stocktake]![YPROD]& "'"

Now what I am trying to do is select something from the item master where
[valid or invalid] = V. How can I add this to the existing query I have
stated above?

What I did try was add another WHERE part to this statement

SQLValid = "Select * from [Item Master] where [part #] ='" and [valid or
invalid]=v
& [Forms]![Actual Stocktake]![YPROD] & "'"

However when I do this, I recieve the following error - compile error -
syntax error. When I have made minor adjustments to this query I always get a
compile error relating to the [valid or invalid] not being defined.

If anyone has any suggestions, that would be great.
Ofer Cohen - 07 Aug 2006 23:15 GMT
Try

SQLValid = "Select * from [Item Master] where [part #] ='" & [Forms]![Actual
Stocktake]![YPROD] & "' And [valid or invalid]= 'v'"

Signature

Good Luck
BS"D

> Hi
>
[quoted text clipped - 18 lines]
>
> If anyone has any suggestions, that would be great.
Jack - 07 Aug 2006 23:30 GMT
Thanks for your help Ofer, but I recieve the following error message

Compile Error - External Name Not Defined

![YPROD] is highlighted.

If you know any other way around this, that would be great.

Cheers
Jack

> Try
>
[quoted text clipped - 23 lines]
> >
> > If anyone has any suggestions, that would be great.
Ofer Cohen - 07 Aug 2006 23:51 GMT
You probably copy and paste the SQL that I provided, and the SQL was cut to a
second row.
Try

SQLValid = "Select * from [Item Master] where [part #] = " & _
 "'" & [Forms]![Actual Stocktake]![YPROD] & _
 "' And [valid or invalid]= 'v'"

Signature

Good Luck
BS"D

> Thanks for your help Ofer, but I recieve the following error message
>
[quoted text clipped - 34 lines]
> > >
> > > If anyone has any suggestions, that would be great.
Jack - 08 Aug 2006 00:14 GMT
Really appreciate your help Ofer, but I now have another problem"

PROGRAM ERROR
An Error has occured. Error #3061
Too few parameters. Expected 1

Cheers
Jack

> You probably copy and paste the SQL that I provided, and the SQL was cut to a
> second row.
[quoted text clipped - 42 lines]
> > > >
> > > > If anyone has any suggestions, that would be great.
Jack - 08 Aug 2006 00:40 GMT
Ignore the previous message - You have solved my problem.

THANK YOU VERY MUCH OFER.

> Really appreciate your help Ofer, but I now have another problem"
>
[quoted text clipped - 51 lines]
> > > > >
> > > > > If anyone has any suggestions, that would be great.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.