Subform is blank

S

Slohcin

I have an application (Access 2003) that has been running OK, but now I have
a problem.
I have a form (1) that contains a subform. This form is driven by a query
whose variable is obtained from a second (2) form.
Entering the variable on form 2 and clicking the 'view' button is supposed
to show the results on form 1, but the subform is blank (white). The odd
thing is that if I run form 1 from the Forms window and enter the variable
manually, the subform works OK.
All the data seems OK and the query returns the expected data.
What could be wrong?
 
S

Slohcin

Sorry for late reply, posted message from home, application at work.
Here is the code:

Private Sub View_Click()
On Error GoTo Err_View_Click

Dim stDocName As String
Dim stLinkCriteria As String


If Me!ViewBox = "" Then
Beep
MsgBox "Please enter a number"
ViewBox.SetFocus
ElseIf Me!ViewBox < 20000 Then
Beep
MsgBox "Number must be equal to or greater than 20000"
ViewBox.SetFocus
Else
stDocName = "ChangeNoteView"
Me!ViewBox = ""
ViewBox.SetFocus
stLinkCriteria = "[ChangeNotes].[ChangeNoteNum]=" & Me![ChangeNoteNum]
DoCmd.OpenForm stDocName, , acFormReadOnly, stLinkCriteria
End If

Exit_View_Click:
Exit Sub

Err_View_Click:
MsgBox Err.Description
Resume Exit_View_Click

End Sub

Hope it helps.
--
Thanks
Slohcin


Jason W Martin said:
What is the onClick event for the 'view' button?
 
S

Slohcin

No reply, so I assume I have foxed everyone.
The problem still exists and I have tried everything that I can think of to
cure it.
Can anyone please give me some help.

TIA
Slohcin
 
Top