I Hate "Where" Clauses !

Aug 27, 2004

I need some help with a Where clause in a SQL statement.

What I am trying to do is use a value that is displayed in a text box on my form as the filter criteria in a list box.

On my first form I have the user select his username from a combo box. He is then prompted for a password. Once he gets past the password form, it allows him access into the main data entry form. Once he's in, the UserID he selected from the first form is automatically displayed in a textbox known as [Text689]. This text box is set to Enabled.False so it can't be changed and it's control source is set to the table as UserID.

I have another listbox setup on the main form as a record selector. This is where it gets confusing. I can get records with no problem, what I can't figure out is how to limit the records the user can select, to what he actually has created. I want to filter his selection options based on his UserID.

I have tried everything I can think of and nothing seems to work. I think the answer lies in the where clause of my SQL statement but it continues to elude me.

example:

Select tblFTEP.[Key#],tblFTEP.UserID,tblFTEP.TraineeID, tblFTEP.DOR,tblFTEP.Date
From tbl FTEP
Where ???????? ;

What I want the where condition to say is, show only those records that match the UserID that is displayed in Text689 on the main form.

Any ideas? I am just about ready to throw this laptop out the window!

View Replies


ADVERTISEMENT

Why Do IT Guys Hate Access?

Sep 26, 2005

Our IT guys are on a vendetta against MS Access (and Lotus Notes but they've
won that fight). What I can't understand is, what's the problem? Why does
IT hate MS Access so much.

I have tried to find out who it is that actually wants to get rid of it, but
I can't find anyone who will admit to trying to get rid of it. Nevertheless,
I'm always hearing about how their "phasing it out" or "getting rid of it".
Because no-one owns up I can't even have an open debate about the pros and
cons of MS Access.

It is certainly amazing what disinformation is out there about what MS-Access
can and can't do. "MS Access clogs up the network". Well yeah... when IT
forces you to install the client of your client server app on the Network
Server it does. How come IT developer's clients can reside on the PC, but a
non-IT developer's client can't? "MS-Access requires you to download a copy
of the data before you can create a management report". Well no, we have a
thing called ODBC. "MS-Access doesn't let you set up views/derived
tables/abstraction layer/ multi-dimensional cubes blah, blah, blah" Well,
actually,... it does! "MS-Access can't publish reports to the web" Wrong!
"You can't upgrade Access 95/97 apps to Access 2000/2003/XP". Bzzzt! Wrong
again!

Meanwhile MS-Access has a number of exceptional strengths (a) an (almost)
comprehensive SDK (b) its cheap (c) lots of people have skills in it (no
$1500/day for an MS Access developer) (d) its well integrated with a
spreadsheet, a wordprocessor and its operating system (e) it's context
sensitive help is nothing short of fabulous (f) it has few limitations with
regard to aggregating aggregates or filtering by aggregates, maintaining
previously calculated data, etc etc. Look I could go on, but I have no
forum to argue my case.

So what is it? Is it the security model of Access? Is it the fear that IT
will be left holding the undocumented spaghetti-coded baby when the non-IT
developer skips town? Is it just that it's Microsoft, and its cool to thumb
your nose at Bill Gates? Or is it that IT doesn't like non-IT people having
access to the VB coding environment which can be used to overcome PC and
possibly Network security? Or is it something else?

I used to be in charge of Oracle DBAs and have been responsible for an
organisation's data management policy. I had nothing against MS Access then.
So what's the deal? :confused:

Regards,
Jeff Popova-Clark
Gold Coast Australia

View 4 Replies View Related

Where Clauses

Jan 10, 2005

I have 3 fields in my db, themeID, occasionID, and recipientID. Each field has its set of numbers. What I want is to get certain products say for recipient 3 but not occasion 3 only if theme is all but 5. How can i do that?

SELECT* FROM tblProduct WHERE RecipientID='3' AND (OccasionID <>'4' AND ThemeID <> '5') order by ItemNumber Asc

i know the code i have written above is incorrect.. i wish i know how to write if is even possible and if statement. Please help.
THanks in advance

View 3 Replies View Related

General :: 2 Group By Clauses

Apr 17, 2013

I want to use to Group by clauses or a Group by and Order By cloause together. Below is what I am striving for. I am using a Union query with a date parameter. When I try to add the Order By Clause I get the error "You tried to execute a query that doe snot include the specified expression 'rate_type' as part of an aggregate function.

System Rate Type ....
Name 1 Fixed ....
Name 1 Variable ....
Name 2 Fixed ....
Name 2 Variable ....

[code]...

View 2 Replies View Related

Modules & VBA :: Open A Form With Multiple Where Clauses

Sep 17, 2013

I am having trouble opening a datasheet form with mulitple where clauses here the VB that I have so far

Private Sub Command192_Click()
If IsNull(Me.Startdate) = True Or IsNull(Me.Enddate) = True Or Startdate = "" Or Enddate = "" Then
MsgBox "Start AND End dates are required" '
Exit Sub '

[code]....

View 11 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved