Solved DoCmd BrowseTo

Local time
Today, 13:46
Joined
Feb 2, 2020
Messages
54
Hi,
I am looking to use the "DoCmd BrowseTo" along with a "Where Condition" to filter a report in place.

I can not for the life of me get the Path to Subform Control argument right. I did try and look at other threads and still can't seem to get it right.

Here is my current setup:

Form: Main
Sitting inside 'Main' is a Navigation Control: Report Center
Sitting inside Report Center is a Form: Contacts Reports
Sitting inside Contacts Reports is a SubReport: DS

When the user selects a name from combo box called cboContact I would like the form to apply a condition to filter the report in place.
The report name is ContactsExtended

My current Macro is attached.
Thank your for your assistance.

Macro_for_BrowseTo.png
BrowseTo.png
 
Hi. I always have a hard time with the path as well. Are you able to post a sample db, so we can play with it?
 
Hi. I always have a hard time with the path as well. Are you able to post a sample db, so we can play with it?

I deleted as much from the DB as possible in hopes it was small enough to attach.
Thank you again for taking a look at it.
 

Attachments

Hi. Just to give you an update, I only fixed the error coming up regarding the Path. I had to remove the space characters from your object names to make it work (I haven't figured out how to include the spaces yet, but it's highly recommended not to use them anyway). However, I will let you fix the problem with the WhereCondition. If you need help with that, I can take a look again tomorrow. Hope this helps...
 

Attachments

Hi. Just to give you an update, I only fixed the error coming up regarding the Path. I had to remove the space characters from your object names to make it work (I haven't figured out how to include the spaces yet, but it's highly recommended not to use them anyway). However, I will let you fix the problem with the WhereCondition. If you need help with that, I can take a look again tomorrow. Hope this helps...

Thank you very much. I'm looking at the WhereCondition now. Of course I don't know why it does not seem to work but I will certainly give it a try before asking. Thank you
 
removed the macro and instead use VBA.
I made a "Copy of qryContactsExtended" (this is the original, untouched).
check changes in query qryContactsExtended.
check the code behind the AfterUpdate event of cboContact.
 

Attachments

removed the macro and instead use VBA.
I made a "Copy of qryContactsExtended" (this is the original, untouched).
check changes in query qryContactsExtended.
check the code behind the AfterUpdate event of cboContact.
Thank you for your edits. It works just fine. My issue now however is that I get Parameter errors because I use gryContactsExtended at various other times in the database. I guess I can create a separate query just to run against this report?
 
Thank you very much. I'm looking at the WhereCondition now. Of course I don't know why it does not seem to work but I will certainly give it a try before asking. Thank you
Hi, I did look at trying to fix the WhereCondition but I can't seem to get it. I know the value from the TempVars is correct but it does not seem to pass it to the report. If I put the [TempVars]![tmpFilterID] in manually as a criteria it works just fine. Your continued help would be much appreciated as this is one of many reports that I plan to use this functionality with.
 
Hi, I did look at trying to fix the WhereCondition but I can't seem to get it. I know the value from the TempVars is correct but it does not seem to pass it to the report. If I put the [TempVars]![tmpFilterID] in manually as a criteria it works just fine. Your continued help would be much appreciated as this is one of many reports that I plan to use this functionality with.
Okay, have a look at the attached. Hope it helps...
 

Attachments

YES THANK YOU!. Would you mind helping me understand what you did so I can learn? I'm not sure I see anything different.
Hi. You're welcome. If anything, it was probably me who broke it while trying to figure out the Path last night. I can't tell now, but it was probably fine before I messed with it. Let me know if you run into anything else, we'll be here to help. Cheers!
 
My issue now however is that I get Parameter errors because I use gryContactsExtended at various other times in the database. I guess I can create a separate query just to run against this report?
just as I have informed you, I made a copy of the Original query "Copy of....".
you just need to rename it and the query of the report.
it is very simple.
 

Users who are viewing this thread

Back
Top Bottom