Navigation Form - button problem

gandalfus

New member
Local time
Today, 03:53
Joined
Sep 21, 2012
Messages
5
Access 2010;

When I load up my form directly from the "Navigation Pane", my "Print/Email" button behaves correctly and brings up my "MainReport" with the current record displayed in the report. !When the "MainForm" is used through a "NavigationForm" the "Print/Email" button behaves differently, in that a pop-up box appears asking me to input a record number instead of automaticly choosing the current record as instructed in my "Print/Email" button. Is there a way to make my "Print/Email" button behave the same when in my "NavigationForm" as it behaves in my "MainForm" i.e. without the pop-up box.

Plese see attached Sample NavigationForm Button for a better explanation.

Many Thanks in advance.

n.b. Thanks again to Trevor G for helping me with my last request, you are a star M8.
 

Attachments

I have never used a navigation form. Looking at your db, what purpose does the Navigation form serve. Why do you need it? It appears that if you just open the main form you get the same thing. I know this doesn't answer your question, but it begs the question.
 
The attached database is only a sample database I created to demonstrate the problem. My actual database has multiple forms that I would like to have in a navigation form and that is why I would like to address the problem.

all the same, I would like to thank you for your involvement.

If anyone out there could help me I would really appreciate it.
 
The sample dB is made in Access 2010, so I cant reproduce the result. But I think it might have something to do with the window mode selected in the macro used to open the main form. Try changing it.
 
The source of your problem is in how Access shows, or rather, doesn't show a subform.

I added a button the same as yours, but with the following Where clause:

[MainData]![RecordNumber]=[forms]![NavigationForm]![NavigationSubform].[Form]![RecordNumber]

It worked as intended.

If you wish to maintain the ability to use either method to open the Mainform, you will need to include code to select the proper reference. If you are only going to use it from the Navigation form, change the Where clause in the embedded macro as indicated. :)

I have tried to discover the reason for the ghosting. It seem the report is not repainting correctly. Clicking Refresh All on the ribbon fixes the problem, but including the Refresh command in the end of the Print macro does not. Maybe this information will help someone discover the root of the problem. The only solution I can think of is to add a close window command to the macro. :/
 
Last edited:
Thank you Kipcliff it now works fine.

n.b. In your answer you stated;
"If you wish to maintain the ability to use either method to open the Mainform, you will need to include code to select the proper reference".

This has raised a new question for me;
!what code and where to put it.

I am brand new to Access and I am finding these navigation forms very difficult so want to retain both options if possible.
 
Quick fix:

Make a duplicate of your button, and change the reference so that you have one for each occasion.

Set the visible and enabled properties of both to No.

Park the new button on top of the old one.

In the On Open event of Mainform, check to see whether Mainform is in the Forms collection. If it is, turn on the old button. If it isn't, turn on the new button.
 

Users who are viewing this thread

Back
Top Bottom