Solved DoCmd BrowseTo (1 Viewer)

Local time
Today, 02:24
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
 

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 23:24
Joined
Oct 29, 2018
Messages
21,467
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?
 
Local time
Today, 02:24
Joined
Feb 2, 2020
Messages
54
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

  • TC6-Temp.zip
    941.9 KB · Views: 98

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 23:24
Joined
Oct 29, 2018
Messages
21,467
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

  • TC6-Temp.zip
    950.2 KB · Views: 94
Local time
Today, 02:24
Joined
Feb 2, 2020
Messages
54
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
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 14:24
Joined
May 7, 2009
Messages
19,228
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

  • TC6-Temp.zip
    1,008 KB · Views: 102
Local time
Today, 02:24
Joined
Feb 2, 2020
Messages
54
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?
 
Local time
Today, 02:24
Joined
Feb 2, 2020
Messages
54
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.
 

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 23:24
Joined
Oct 29, 2018
Messages
21,467
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

  • TC6-Temp (2).zip
    942.1 KB · Views: 118

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 23:24
Joined
Oct 29, 2018
Messages
21,467
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!
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 14:24
Joined
May 7, 2009
Messages
19,228
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

Top Bottom