Go to the same record

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Please help!

I have a form with a main page as member loopup follow by many subforms
(pages). The member loopup page links to a table MEMBER while the subforms
link to some other tables, e.g. Asthma, Diabetes. I have a button to set
focus to the correct subform. What is the correct syntax to just limit the
searched member in loopup form to the subform?

I tried: DoCmd.GoToRecord , , acGoTo, "[Member#] = Forms![Program
Tracking]![Child59]![Member#]"
but it erred me out with the wrong data type.

Thanks inadvance,
Sheridan
 
Hi Sheridan,

If you set up your Link Master Field/Link Child Field correctly for each
subform, Access will ensure that the correct records are brought up in the
subform. In the example you gave, you would link on [Member#].

Can I also suggest that using non-alphanumeric characters or spaces in
object names (tables, fields, controls etc) is a recipe for disaster later on
- you should probably try to avoid this!!

Hope this helps.

Damian.
 
Thank you for the advise on naming convention on object names, Damian.

I tried the Link Master/Child Field before but that was not exactly what i
want. Here is my dilemma. I want to link to the same member in the subform
but also will be able to view all records in the subform if I click Show All
button (DoCmd.ShowAllRecords). The Link Master/Child in design window seems
override all VB Script codings.

Any advise?

Thanks,
Sheridan

Damian S said:
Hi Sheridan,

If you set up your Link Master Field/Link Child Field correctly for each
subform, Access will ensure that the correct records are brought up in the
subform. In the example you gave, you would link on [Member#].

Can I also suggest that using non-alphanumeric characters or spaces in
object names (tables, fields, controls etc) is a recipe for disaster later on
- you should probably try to avoid this!!

Hope this helps.

Damian.

Sheridan said:
Please help!

I have a form with a main page as member loopup follow by many subforms
(pages). The member loopup page links to a table MEMBER while the subforms
link to some other tables, e.g. Asthma, Diabetes. I have a button to set
focus to the correct subform. What is the correct syntax to just limit the
searched member in loopup form to the subform?

I tried: DoCmd.GoToRecord , , acGoTo, "[Member#] = Forms![Program
Tracking]![Child59]![Member#]"
but it erred me out with the wrong data type.

Thanks inadvance,
Sheridan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top