Macros running twice

dhans

Registered User.
Local time
Yesterday, 22:12
Joined
Dec 11, 2013
Messages
12
I have a couple of forms in a navigation menu that have command buttons, one which is a print function and on the other form I have a command button that calls up a query that performs a filter function (the query has 2 user input parameters).

The commands perform perfectly fine, however they run twice. In other words, when you click the command button, it asks for your parameters twice--parameter 1, parameter 2 and then again parameter 1, parameter 2. The same with the print function--it brings up the print menu box and then brings it up again after you close the 1st one.

My question is just in regards to where would you suggest I look for an answer to why this is running twice? Obviously I have something checked or unchecked somewhere.

I have other forms in the Navigation Menu that have similar/same command buttons and they run as expected, one time.

Note that these are all run via macros, and I have not used VBA code for any of these simple functions--nor do I want to, so please do not refer me to some long involved VBA coding as it's such an easy function to use macros.

Thanks in advance for all suggestions.
 
What is the code/macro behind the button?
 
There's a setfilter command that calls a query which uses 2 user input parameters. (solving this one will point me in the right direction for the same type problem in the 'print' cb)

Setfilter
Filter Name Semester & Year Query

Query SQL:

PARAMETERS [Year:] Text ( 255 ), [Semester:] Text ( 255 );
SELECT [SEMESTERS MASTER].SEMYEAR, [SEMESTERS MASTER].SEMESTER, [SEMESTERS MASTER].COURSE_NO, [SEMESTERS MASTER].COURSE_NAME, [SEMESTERS MASTER].CAMPUSCODE, [SEMESTERS MASTER].SemMxDayLU, [SEMESTERS MASTER].FACULTY, [SEMESTERS MASTER].MAX_SEATS, [SEMESTERS MASTER].SUMMERSEM, [SEMESTERS MASTER].NOTES_REQS
FROM [SEMESTERS MASTER]
WHERE ((([SEMESTERS MASTER].SEMYEAR)=[Year:]) AND (([SEMESTERS MASTER].SEMESTER)=[Semester:]));


The form is in a tabbed navigation form. I've tried deleting the cb and recreating it in a couple different ways. I've created it directly on the form the navigation menu uses, and I've tried creating it on the form from withing the navigation menu. Same problem both ways. It executes twice and I'm just stumped on why. Navigation menus seem to be tricky for me. ;)
 
Do you think it could be because I'm calling for 2 parameters? I'm using the same logic in other forms in my navigation menu which only use 1 parameter in the query and they work fine.
 
Are you opening the query then the report that's based on it? If so, you don't need to open the query first.
 
The report is embedded in a tabbed navigation form/menu--a subform(?). I suppose I could put in a command to open the report and then another cb to filter from that, but I have several other forms/reports in this menu with this same sort of cb that works just fine without doing that. It's become a mission now to get this to work correctly.
 
Can't post a screenshot of what my navigation menu looks like until I post one more time.
 
I think I may have solved this problem. Instead of using the report and querying from that, I'll just create a form from the query. I'll let you know if it solves the problem or not.

But any other suggestions are welcome.
 

Users who are viewing this thread

Back
Top Bottom