次のスクリプトは、5行目で 'end of statement is expected'エラーを表示しています。私は正しく動作する他の同様のスクリプトを持っていますが、3行目はありません。私はアイテムIDを持っていないラインを持っています。それはなぜライン2をそこに置くのかです。申し訳ありませんが、それは乱雑です - 私はこれで非常に新しいです!vbスクリプトで 'end of statementが必要です'
Private Sub Export_BeforePrint(ByVal sender As Object, ByVal e As System.Drawing.Printing.PrintEventArgs)
If GetCurrentColumnValue("IMA_ItemID") Is Nothing Or GetCurrentColumnValue("IMA_ItemID") IsDBNull Then
Me.Export.text = "" _
ElseIf GetCurrentColumnValue("IMA_ItemID") isnotnull AND GetCurrentColumnValue("IMA_CountryOfOrigin") = "USA" Then
Me.Export.text = "*** These commodities, technology, or software were exported from the United States in accordance with the Export Administration Regulations. Diversion contrary to United States law is prohibited."
Else
Me.Export.text = ""
End If
End Sub
私が2行目に入る前は、このように見えました。しかし、その後、itemidのがnullだったときに印刷するときに、私はエラーを取得した
Private Sub Export_BeforePrint(ByVal sender As Object, ByVal e As System.Drawing.Printing.PrintEventArgs)
If GetCurrentColumnValue("IMA_CountryOfOrigin") = "USA" Then
Me.Export.text = "*** These commodities, technology, or software were exported from the United States in accordance with the Export Administration Regulations. Diversion contrary to United States law is prohibited."
Else
Me.Export.text = ""
End If
End Sub
ここおかげ
は、行番号のないコードです。申し訳ありません - それは私の質問を理解しやすくすると思った:とjmcilhinneyありがとう - 私はあなたのisnotnullを何も変えなかった。
でそれを確認することができますか? – Steve
VB.NETにはisnotnullというものはありません。あなたは 'IsNot Nothing'またはおそらく' IsNot DBNull.Value'を意味しましたか?データベースがnullの場合? – jmcilhinney
行3の末尾にある '_'を削除します。 – Slai