Macro "Where" Clause

Axle_The_Red

New member
Local time
Today, 11:58
Joined
Jul 1, 2008
Messages
6
Hi! I'm pretty new to Access, but I've got a few years of coding experience behind me...and I can't figure this out.

[Current].[Location] Like "*" & [Enter Location:] & "*"

This is the Where clause in my macro. It's supposed to open a form by searching for a location which the user is prompted for. However, when doing so, two prompts appear instead of one. The first says "Enter Parameter Value" and has "Current.Location" as the prompt. The second prompt asks "Enter Location:" (which is what I want it to do).

If I copy the code to a query, it doesn't have two input prompts, only the "Enter Location" that I want...I'm not sure what I'm doing wrong. Is the macro Where clause different than the query one somehow?

I'm using Access 2003 if it makes a difference.

Thanks!
 
The macro where clause is for the execution of that line of the macro...

Having said that... DONT EVER user macro's for anything you can do in VBA! :D

VBA is much more flexible and easier to maintain in the long run than Macro's are.
 
Wait...none of that made sense except the part where you said don't use macros. :P

This may be kind of dumb, but I'm not familiar with VBA. Just C++ and Java mostly...although I've been told (multiple times) VBA is very VERY easy...although I'm only working here for about two to three more weeks and then I'm back to school...so I don't really see much of a point in learning VBA that quickly...
 
You have a line in the macro which has a where clause.
This where clause determains when the line in the Macro is executed, this where clause has no baring on the query in any way shape or form...

Only if you put the [Enter Location:] in the query will it be triggered properly as you want it to....

BTW
How come companies hire school kidds to do a profesional's job?? *GRMBL* This is rediculous!


Now does that make more sence?
 
Hm...so in that case, how would I get the macro (or whichever way I should do it) to open a form with records that match a search input entered by the user?

If it makes you feel any better, it wasn't really a part of my job description, I just kind of got sucked into it. :P
 
Well how about just putting the critiria in the query?? Or on the form it self?

What are you trying to do with this Macro??

Sucked into a DB building job without knowledge of the DB? *geez*
Companies trying to be getting top-dollar development done for pennies AND then come complain to us Profesionals how Access sucks !!! *GRMBL*
 
I'm trying to implement a search function. For example...I want all the records by X location which is prompted for. After the prompt is entered, I want all the records that fit that criteria to show up in a form (browsable a record at a time).

Heh. I'll grumble how Access sucks...that's just me though. Specifically cause I'm so new to it and I have not much of an idea of what I'm doing with it. :P
 
Heh. I'll grumble how Access sucks...that's just me though. Specifically cause I'm so new to it and I have not much of an idea of what I'm doing with it. :P
With all due respect this is exactly my problem...

OK...

But you had your desired effect working or not?? Just put the [Give location:] in the query criteria, open the form and it will pop up...
Not the greatest of solutions but it works.
 
Well...the result I want happens...but it's accompanied by an extra prompt that I don't want.

I want it to be all form driven so people don't have to go hunt through tables and queries and all that. I just want something people can click on buttons to navigate (ex: the search by location button)...
 
Mr. Folley? I don't get the joke...

When I click on the link I get this:

Sorry - no matches. Please try some different terms
 

Users who are viewing this thread

Back
Top Bottom