How can i make my Else..If statement make look no so
cumbersome? Besides the condition for previewing the report
doesnt work,may be my If condition does no apply properly.
Perhaps this is due to the many conditions in my If else statements.
Do i have a mistake in my function CmdStockReceipt ?
Private Sub CmdStockReceipt_Click()
Dim f As Form
Set f = Forms![FOrderInformation]
If IsNull(f![LstStockReceipt]) Then
DoCmd.Beep
MsgBox " Please select Order first ! "
Exit Sub
Else
Dim stLinkCriteria As String
Dim stDocName As String
stDocName = "Invoice"
stLinkCriteria = "orderid = " & f![LstStockReceipt]
Dim intPrint As Integer
Dim intAnswer As Integer
intAnswer = MsgBox(" Delete? ", vbQuestion + vbYesNo)
If intAnswer = vbYes Then
Application.Echo False
CancelOrderOnOffice
Else
intPrint = MsgBox(" Print? ", vbQuestion + vbYesNo)
If intPrint = vbYes Then
FncPrint
Else
DoCmd.OpenReport stDocName, acPreview, , stLinkCriteria
VisibleOrder
Reports![invoice]![LblStockreceipt].Visible = True
End If
End If
End If
End Sub
*** Sent via Developersdex
http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!