Form behaving strangely (1 Viewer)

Tanya

Access Novice
Local time
Today, 09:11
Joined
Sep 7, 2008
Messages
165
Hi
I have a form ICTOutcomes and when I open it on its own it works fine. The form has two subforms, the second of which is updated by a masterlink OutcomeIDLink unbound txt field.

Here is the problem:
When I open ICTOutcomes form frmClasses using the following code

Private Sub CmdViewICTOutcomes_Click()
DoCmd.OpenForm "frmICTOutcomes", , , , , acDialog

End Sub

so long as I don't have any classes selected the code works fine, however if I do have a class open and use the same code the form doesn't cooperate and I have to click in the area of the second subform for it to update.
Does anyone have any ideas why this is? I have spent days on this problem.

Thanks in advance

Regards
Tanya
 

gemma-the-husky

Super Moderator
Staff member
Local time
Today, 17:11
Joined
Sep 12, 2006
Messages
15,715
what if you dont specify acdialog

see if that makes a difference

or put a breakpoint in the the open event for ictoutcomes, and trace the program execution
 

Tanya

Access Novice
Local time
Today, 09:11
Joined
Sep 7, 2008
Messages
165
Hi
I tried not specifying acdialog and it hadn't made any difference.
Not sure what you mean about a breakpoint in the open event for ictoutcomes and would appreciate your explaining this.
Thanks
Tanya
 

Tanya

Access Novice
Local time
Today, 09:11
Joined
Sep 7, 2008
Messages
165
After considering your post further, I had a look at frmICTOutcomesSub and used the following code:

Private Sub Form_Current()
Dim ParentDocName As String
On Error Resume Next
ParentDocName = Me.Parent.Name
If Err <> 0 Then
GoTo Form_Current_Exit
Else
On Error GoTo Form_Current_Err
Me.Parent![frmICTOutcomesPerformanceSub].Requery
End If
Form_Current_Exit:
Exit Sub
Form_Current_Err:
MsgBox Error$
Resume Form_Current_Exit
End Sub

Which has been successful.

Thank you for the suggestion, it led me in the right direction.

cheers
Tanya
 

Users who are viewing this thread

Top Bottom