The macro BrowseTo jumps to the proper tab but display empty form

ZikO

Registered User.
Local time
Today, 12:25
Joined
Dec 15, 2012
Messages
41
[SOLVED] The macro BrowseTo jumps to the proper tab but display empty form

Hello,

I am working on a project in ACCESS 2010. I have recently tried to improve the project functionality by applying a Navigation Form.

There are two subforms that I wish they could interact with each other. The first form contains information related to a vacancy such as name of company. The second subform contains detailed information about all companies. My intention is to have a button in the fist form that I can click on and cause ACCESS to jump into the second subform whose record is supposed to be set to company assigned to the vacancy.

To accomplish the task, I read and found out that BrowseTo() function is dedicated to this kind of scenarios. This function does not work in my situation and I truly cannot understand why.

The main form name: frm_navigation
The name of the first form: frm_vacancies
The name of the second form: frm_Organizations
There also tables: tbl_vacancies and tbl_ogranizations

The macro looks like this:
Code:
BrowseTo:
                Object Type: Form
                Objact Name: frm_Organizations
    Path To Subform Control: frm_navigation.NavigationSubform
            Where Condition: [tbl_organizations].[PR_ID]=[Forms]![frm_navigation]![NavigationSubform].[Form]![cb_org_name].[ControlSource]
 
Last edited:
Hi,

It's not completely clear to me since it looks like your text was cut off in mid sentence in your message post. What is it doing at the moment? Showing an error? Something else?

Without knowing the exact fields names in each table (that would help us trying to test out on our own machines) I'm only guessing.

I think your Where clause might need to be something like so:

[PR_ID]=[Forms]![frm_navigation]![NavigationSubform].[Form]![cb_org_name]

--------------------
Jeff Conrad - Access Junkie - MVP Alumnus
SDET II - Access Test Team - Microsoft Corporation

Author - Microsoft Access 2010 Inside Out
Co-author - Microsoft Office Access 2007 Inside Out
Access 2007/2010 Info: http://www.AccessJunkie.com

----------
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.mspx
----------
 
Hi,
The solution you have provided works :) Thank you

I am sorry for not giving you the details of the tables and also I did not spot I left the text after the code that was not supposed to be there. I am glad you answered this thread anyway :)

The definitions of both tables are following
Code:
tbl_organizations(
	PR_ID	Autonumber,
	FR_ID	Number,
	org_name	text,
	...
)
Code:
tbl_vacancies(
	ID	Autonumber,
	...
	organization_id,
	...
)

The only thing I am confused about is a combo box in a form bound to the table tbl_vacancies. All columns in the combo box are populated via SQL expression. How do I control which value is read from a combo box when the expression refers to that combo box? Is it done by property Bound Column?

Also, I did not know I could simply use a name of a combo box to refer to its value :)
 

Users who are viewing this thread

Back
Top Bottom