W
Wendy
Hi
I'm new to the vb side of access and would like to get a message box to
display the results of a query (or query turned into sql) whilst the user is
running a macro with the option for them to cancel out of the macro if the
displayed results are not correct. I'm having trouble getting the
messagebox to act on the sql code, all I can make it do is display the code.
What am I doing wrong please? This is my code.
Wendy
Sub Bankline()
Dim strMsg, myTitle, sqlstring, style
style = vbOKCancel
sqlstring = "SELECT bank.TRANSDATE, bank.AMOUNT, bank.DETAILS,
bank.TRANSCODE,bank.CHEQUENO WHERE (([bank].[TRANSCODE]) Not Like 'CC' And
Not Like 'MSC' And Not Like 'CHG'))"
myTitle = "MsgBox bank Records" ' Define title.
msgbox "The first record in the file is " & sqlstring & vbOKCancel
If Response = vbCancel Then End
End Sub
I'm new to the vb side of access and would like to get a message box to
display the results of a query (or query turned into sql) whilst the user is
running a macro with the option for them to cancel out of the macro if the
displayed results are not correct. I'm having trouble getting the
messagebox to act on the sql code, all I can make it do is display the code.
What am I doing wrong please? This is my code.
Wendy
Sub Bankline()
Dim strMsg, myTitle, sqlstring, style
style = vbOKCancel
sqlstring = "SELECT bank.TRANSDATE, bank.AMOUNT, bank.DETAILS,
bank.TRANSCODE,bank.CHEQUENO WHERE (([bank].[TRANSCODE]) Not Like 'CC' And
Not Like 'MSC' And Not Like 'CHG'))"
myTitle = "MsgBox bank Records" ' Define title.
msgbox "The first record in the file is " & sqlstring & vbOKCancel
If Response = vbCancel Then End
End Sub