468,770 Members | 2,263 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,770 developers. It's quick & easy.

Help with the "BrowseTo" command

22
I could use some help with the BrowseTo feature in access 2010. I have searched for and read everything I can find on the web... which wasn't much.

Can browseto be used on a form other than a navigation form, if so, how do you set the file path? I have tried to follow the examples given here: http://blogs.office.com/b/microsoft-access/archive/2010/02/23/access-2010-browseto-docmd-and-macro-action.aspx and I can't get it to work.

I see a lot of similar comments on other forums... is there an expert who can help solve the mystery?

The example in the link above gives a file path for a form with several layers of subforms, and I am not sure how to apply it to my situation which is very simple...

I have a main form with two subforms, one is the continuous form (the list of contacts in the address book sample) that stores the browseto on click event, and the 2nd is the subform that is like the "name card" in the example.

Try as I might, I cannot figure out how to make this seemingly useful trick work... any and all help greatly appreciated!
Oct 2 '11 #1

✓ answered by nico5038

This is possible. Just start with the listbox with the children and use the linkage fields to a subform to the relationship table "Child/Adult"

Next add an unbound field "txtAdultID" on the parent form and add to the subform with the relationship table a OnCurrent event holding this line of code:
Expand|Select|Wrap|Line Numbers
  1. Parent.txtAdultID = Me.AdultID
  2.  
Finally add a subform for the adult and use the "txtAdultID" field in the linkage fields.

Thus selecting a child will show the related adults and their role and te selected adult will appear in the subform Adult.

Getting the idea?

Nic;o)

12 3983
nico5038
3,079 Expert 2GB
I'm always reluctant to try new Access features, especially when good "solid" alternatives are present.

For your design (Namelist showing subform with detail data) there's a simple mechanism on a main form:
1) Make a listbox with the names and (hidden) the ID in the first column.
2) Add a subform and use the linkage fields to link the subform to the value of the listbox (being the ID field)

That's all and no BrowseTo with multiple parms needed.

Nic;o)
Oct 2 '11 #2
CharT
22
Thanks- I'll give that a shot. :)
Oct 2 '11 #3
CharT
22
sorry- stuck again... maybe what I am after isn't possible...
My application is for a child welfare setting...
I have a table with 300+ kids. Every kid can have multiple adults with various relationships to the child (bio mom, care giver, foster mom, etc)

I have a form "child census". There is a page (tab) for adults that are related to that kid.

I have a relationships table that joins the child to his/her adults and defines the relationship.

I have a subform (and underlying table) for adult details such as incarcerated, drug abuse, etc.

I would like to create a list of adults (much like the example of the address book)but only those adults that are related to the child who's record is currently selected in the main child form.

I created a query with the adult id and the child id, and the child id criteria is set to the child id control in the main form. So, the query is working great... if i bring up a child in my main form, only that child's adults appear in the query results.

How do i get that query to become the record source for a list from which (with an on click event) i can load that adult's detail record in the subform???

I have used the listbox wizard, selected my query, etc, but when i go back to report view the list results (from my query) are not showing, instead, the first adult on the adult table appears and nothing else.

I know someone out there can help me... I hope!
Oct 2 '11 #4
nico5038
3,079 Expert 2GB
This is possible. Just start with the listbox with the children and use the linkage fields to a subform to the relationship table "Child/Adult"

Next add an unbound field "txtAdultID" on the parent form and add to the subform with the relationship table a OnCurrent event holding this line of code:
Expand|Select|Wrap|Line Numbers
  1. Parent.txtAdultID = Me.AdultID
  2.  
Finally add a subform for the adult and use the "txtAdultID" field in the linkage fields.

Thus selecting a child will show the related adults and their role and te selected adult will appear in the subform Adult.

Getting the idea?

Nic;o)
Oct 3 '11 #5
CharT
22
I will work on this as soon as possible and let you know how it goes. Thank you!!
Oct 3 '11 #6
CharT
22
Hello Nic, I have been trying to get this to work for several hours. I must be doing something wrong, or, I may not have described my goal clearly enough to begin with...

I would like to use a continuous form with an on click event to generate the correct record in an adjacent form.

The subform that generates the list is a continuous form, named "AdultList" who's record source is a query that selects adults that have a relationship with the current child in the main form, and includes the fields "Child id" "adult id" and "adult name". The criteria for the child id is set as the child id in the main form. This seems to be working correctly, if i select a child in my main form, the list of adults that are related are produced in the continuous subform.

The adjacent subform, named "RelationshipLookup" who's record source is a query that selects the table named "Relationships" and includes the field "adult id" and "child id"; is linked on child id to the main form. This subform also is working correctly, when a child is selected in the main form, only those adults records are generated. This form's view is set to single form. This form is for entering the details of the relationship, such as biological parent, foster parent, etc.

My goal is to be able to click on a name in the continuous form on the left side of the page, and have that record generated in the adjacent (single form view) form on the right side of the page.

I am sorry to bother you again, but I have tried to do this on my own and i am just not getting it. Can you help again please?
Oct 10 '11 #7
nico5038
3,079 Expert 2GB
Can you attach a sample .mdb with the tables and forms so I can have a look ?

Nic;o)
Oct 10 '11 #8
NeoPa
32,131 Expert Mod 16PB
@CharT
I expect Nico will be in a better position to help if you follow the instructions found in Attach Database (or other work) before attaching your database.
Oct 11 '11 #9
CharT
22
Hello all- WOW I finally got this to work... I was able to create a text box on the main form and make its source the adult id in the continuous form, then, link that text box to the detail subform adult id. I am not sure why it took so much trial and error, but it is working. There is a bit of a lag for the detail subform to populate, but it's working. Thanks so much for the continued support :)
Oct 11 '11 #10
NeoPa
32,131 Expert Mod 16PB
Excellent news :-) And well done for turning the tips passed into a working solution.

Now, if you could determine which of Nico's posts most pointed you in that direction and select it as the Best Answer then we can consider this thread completed.
Oct 11 '11 #11
CharT
22
Although I did not use the code provided, I was able to use the tips about linking child and master fields to finally get a solution. I left out one thing I did, I put the adult id control in the form header of the continuous form, so that when an adult name (in the detail section) was selected, the adult id was selected as well. I used that adult id as the source for the text box on the main form and then linked that to the detail subform. I am not sure it that is the best thing to do, but it works. Thank you again!
Oct 11 '11 #12
nico5038
3,079 Expert 2GB
Great to see you managed to get it working. I always see that as the best result, as it gives the satisfaction that you've "done it".

Success with the application !

Nic;o)
Oct 11 '11 #13

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

2 posts views Thread by ntsNews | last post: by
3 posts views Thread by McCarthy | last post: by
AmberJain
6 posts views Thread by AmberJain | last post: by
1 post views Thread by CARIGAR | last post: by
1 post views Thread by Marin | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.