How to reference form in navigation form

bikermo

Registered User.
Local time
Today, 07:19
Joined
Jan 8, 2013
Messages
38
I have inherited maintenance of an Access DB that I did not design and I'm having trouble with their Navigation Form setup.

I created a form with a list box and two date fields, and figured out how to build a filter for the form that would open a specified report on a button click. It worked great as a stand-alone form, but when I added it to a navigation control in a navigation form I can't seem to find the right path to tell the VBA where to look for the filter criteria.

(image attached, or view via my public dropbox folder here: https://www.dropbox.com/home/Public?preview=navigation+form.jpg)

In the screen shot, the report to be displayed is in the detail of the "Report Center" tab on the far right of the navigation form "Main." the form "FilterSelection" is inserted in the "NavigationControl0" section under the navigation tabs. Criteria is selected/entered in "FilterSelection" and needs to be passed to the filter of the report that is opened when the "Project Tasks" navigation button is pressed. As I mentioned, when I created the form I put a button on it to open the form with the filter (built via SQL in VBA) it worked beautifully. But now that it's on the "NavigationControl0" object Access errors and can't find the fields where the data has been selected/entered. I have tried many different combos of referencing the forms and I've searched but I'm not finding anything that has helped so far. :banghead:
 

Attachments

  • navigation form.jpg
    navigation form.jpg
    100.6 KB · Views: 240
Hi, It seems to me that the VBA for that Project Task button needs to read the criteria of the Filter Sub-form and then Set the Filter for the Other Project Sub-form. Is that what you are trying to do? Or do you have code in the OnCurrent or OnActivate of the Project sub-form that is supposed to read the filter sub-form?

Either way maybe a solution would be to create a global variable or global class that can hold the filtered information and then it will be available to any form.

Hope this makes sense.
Dave
 
Post a stripped down version of your database with some sample data in it, zip it!
 
thanks JHB, i will try to strip out data, leave some shell data, and upload. got a bunch of meetings this morning so it will be afternoon (stateside) for me.

thanks also, davestuart, i'm just not understanding your lingo at this early hour, but i'll try to answer that question this afternoon as well.
 
thanks JHB, i will try to strip out data, leave some shell data, and upload. got a bunch of meetings this morning so it will be afternoon (stateside) for me.
Okay - then I wait for the database. :)
 
all right, all data changed to to generic data so you can still see what reports are supposed to look like.

On the "report center" tab the report choices are on the far right. the first one, "Project Tasks" is the one i'm working on, the other 3 tabs still work because there is no "build filter SQL" code behind the button, only "open report" command (once i figure this out i'll change those to open with the filter too). The code to build the SQL filter also uses default dates because i couldn't figure out how to code "between" using "*", so if you have suggestions on that i'd be thrilled, because my way doesn't show those where the date has been left blank.
 

Attachments

i swear i must have tried every combination of "Me.xxx.xxx.Value =" and never got it to work. you're my hero! so happy that i can finally close this project off my list and give it back to the user.

thanks a million!!
 
You're welcome, good luck! :)
 

Users who are viewing this thread

Back
Top Bottom