Advertisement

07.31.2008 at 04:26PM PDT, ID: 23612815
[x]
Attachment Details

Using Tabbed Forms and want a command button to open another detailed form

Asked by softsupport in Access Coding/Macros, Access Forms

Tags: Microsoft, Access, 2003

I have a form with several tables, ParentInfo, ChildInfo, ChildImmunization.
Forms are tabbed
The main form is [ParentInfo] form
One of the tabbed forms [ChildInfo] form is related to the [ParentId] form by the field "Parentid'
On the [ChildInfo] form, I want to add a command button to open another form to show immunizations for this child.  The [ChildImmunization] form has the field "childid".  The command button works when I open the ChildInfo form by itself (in other words, not in the [ParentInfo] form, and automatically enters the childid field in the record, but when the form is open from the main form [ParentInfo] form the command button does not enter the childid.   What am I doing wrong?
Below, please find code for the command button.
Thanks in advance.

Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
Private Sub Command86_Click()
On Error GoTo Err_Command86_Click
 
    Dim stDocName As String
    Dim stLinkCriteria As String
 
    stDocName = "frmChildImmunizations"
    
    stLinkCriteria = "[ChildID]=" & Me![ChildID]
    DoCmd.OpenForm stDocName, , , stLinkCriteria
 
Exit_Command86_Click:
    Exit Sub
 
Err_Command86_Click:
    MsgBox Err.Description
    Resume Exit_Command86_Click
    
End Sub
[+][-]07.31.2008 at 05:46PM PDT, ID: 22134732

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Access Coding/Macros, Access Forms
Tags: Microsoft, Access, 2003
Sign Up Now!
Solution Provided By: wiswalld
Participating Experts: 2
Solution Grade: A
 
 
[+][-]07.31.2008 at 06:03PM PDT, ID: 22134808

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.01.2008 at 08:37AM PDT, ID: 22139345

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.01.2008 at 09:14AM PDT, ID: 22139676

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]08.01.2008 at 10:31AM PDT, ID: 22140313

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.01.2008 at 02:30PM PDT, ID: 22142117

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.02.2008 at 08:07PM PDT, ID: 22146329

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.02.2008 at 08:09PM PDT, ID: 22146332

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628