Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Weird Macro Enter Parameter Value Problem

Status
Not open for further replies.

2manyerrors

Programmer
May 14, 2009
36
US
Hi yall.
I hope someone can help me. Here is my situation. I have a macro that opens up a query which asks for an input. The query has this, [Please enter the Vendor Num to update?] in the Vendor_Num field as the criteria.

When a button is pressed and it run a macro that opens the query, it works fine but right after I input a vendor number in the "Enter Parameter Value" prompt and hit enter, a second "Enter Parameter Value" prompt appears. The second prompt has only an equal sign in it. If I hit the enter button then my query will return the vendor information that I had requested.

Does anyone know why this occurs? I just can't get rid of the unneeded second prompt...

Thanks for any help.
 
Hi dhookkom,

Okay, here is the sql for the query. The table has five fields but in the query I am only using one. When I run the macro, I get the second prompt with the = thing but when I run the query it works fine.

Here is the sql for my query.

SELECT CPP_Contractors.Vendor_Num
FROM CPP_Contractors
WHERE (((CPP_Contractors.Vendor_Num)=[Please enter the Vendor Num to update?]));

Hope you can help. Thanks much. By the way, there is nothing special about the database, it is super simple with about four tables, one switchboard, six queries, three forms, eight macros and only one report.
 
If the query runs fine but the macro that calls the query doesn't then I expect there is something wrong in your macro. I don't use macros but you should look for anything in the conditions or whatever. This doesn't feed a form or report does it?

BTW: I hate parameter prompts. There is an FAQ in the Queries forum that describes why they are evil ;-)

Duane
Hook'D on Access
MS Access MVP
 
Okay. I will keep working with it.

The query does not feed any form or report.

Do you know another option to make query run without a macro from a button?
 
I don't know what happened but it is fixed. I deleted the forms, queries and macros. I then recreated them and seems to work fine. Very odd but thanks for everyone's help. Thanks so much.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top