Filling data from one subform to another

G

Guest

I'm having difficulty with syntax for filling a value from one subform to
another, based on values selected in the parent form. I have the following
code in the After Update event of CategoryID control on the parent form:

'Fills the Request Type control (OCSE or State) on the QUICK Errors tab if
the Program Area selected is QUICK and the Category is System Error.
If Me.[ProgramID] = 5 And Me.[CategoryID] = 2 Then
Me!Tab9_QUICKErrors![txtRequestType] = _
Me!Tab5_StateInfo![cboRequestType]
End If

The controls titled "Tab" are the controls for the subforms, not the subform
names. Both subforms are on a tab control, but from researching the
newsgroups, this shouldn't be named.

Any suggestions.
 
I

IanOxon via AccessMonster.com

The syntax for referencing subform controls is Forms![Form Name]![Sub Form
Control Name].Form![Control on Sub Form] or Me![Sub Form Control Name].Form!
[Control on Sub Form]. Things you might also want to check are:
1. Is the AfterUpdate event being trapped? Inserting a debug.print statement
or msgbox at the start of the procedure will help confirm this.
2. Are your conditions being met? Inserting additional code as in 1 in the
conditions statement will confirm this.

Regards Ian

Susan said:
I'm having difficulty with syntax for filling a value from one subform to
another, based on values selected in the parent form. I have the following
code in the After Update event of CategoryID control on the parent form:

'Fills the Request Type control (OCSE or State) on the QUICK Errors tab if
the Program Area selected is QUICK and the Category is System Error.
If Me.[ProgramID] = 5 And Me.[CategoryID] = 2 Then
Me!Tab9_QUICKErrors![txtRequestType] = _
Me!Tab5_StateInfo![cboRequestType]
End If

The controls titled "Tab" are the controls for the subforms, not the subform
names. Both subforms are on a tab control, but from researching the
newsgroups, this shouldn't be named.

Any suggestions.
 

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

Top