cdavisdccb
Programmer
I am using the following procedure on a form to
- clear and refill a temporary table (temptblTree) with all sublevel parts (Toplevel = Me!ITMKEYID)
- open the report which is supposed to show this table
The problem is: When the report opens, only the first two records from the table show up. If I open the report manually, everything is fine.
Any suggestions?
thank you.
*********** code: ***********
Private Sub OpenBOM_Button_Click()
On Error GoTo ErrNoData
lngCounter = 0 'public as long
Call tblTemp_Clear 'deletes all records in temptblTree
Call BuiltMultiLevel(1, Me!ITMKEYID) 'fills sublevel parts in temptblTree
If DCount("*", "temptblTree" > 0 Then
DoCmd.OpenReport "_repBOM", acPreview
RunCommand acCmdFitToWindow
Else
MsgBox "This part contains no sublevel parts", _
vbInformation + vbOKOnly, "OK"
End If
ErrNoData:
If Err = 2501 Then Exit Sub
End Sub
"It doesn't matter how idiot-proof you make it, someone makes a better idiot!"
- clear and refill a temporary table (temptblTree) with all sublevel parts (Toplevel = Me!ITMKEYID)
- open the report which is supposed to show this table
The problem is: When the report opens, only the first two records from the table show up. If I open the report manually, everything is fine.
Any suggestions?
thank you.
*********** code: ***********
Private Sub OpenBOM_Button_Click()
On Error GoTo ErrNoData
lngCounter = 0 'public as long
Call tblTemp_Clear 'deletes all records in temptblTree
Call BuiltMultiLevel(1, Me!ITMKEYID) 'fills sublevel parts in temptblTree
If DCount("*", "temptblTree" > 0 Then
DoCmd.OpenReport "_repBOM", acPreview
RunCommand acCmdFitToWindow
Else
MsgBox "This part contains no sublevel parts", _
vbInformation + vbOKOnly, "OK"
End If
ErrNoData:
If Err = 2501 Then Exit Sub
End Sub
"It doesn't matter how idiot-proof you make it, someone makes a better idiot!"