Hi Cor,
thx for the code,
Im a liitle confused on how MyProc works though!!.
How do i ensure that for the second part of my if
stataments a message box is displayed if either one of my
textboxes are empty (Or both)?? (i.e i am using 2
textboxes in this case so that the user can search by
their first and last name)
Does the code u showed me below only meant for a single
textbox? if so how can it be modifed?
also y do have a NOT for the first textbox (text2) and not
for text1?? .....
if Not text2 Is Nothing then
if text2.text ="" then
messagebox.show(error)
return false
end if
end if
if text1.text = "" then
messagebox.show(error)
return false
end if
return true
end function
One final question.....
How do i integrate an if statment into your code that
displays that the results of the query are empty? At the
moment the datagrid just shows up empty with just the
column headings? Im not to sure on how to code this?
Can the if statment u provided me be extended to include
any number of if staments e.g...
if Combobox1.text = xxx then
if myproc(textbox1, nothing) = true then
'run stored procedure 1
end if
elseif
if Combobox1.text = yyy then
if myproc(textbox2, textbox3) = true then
'run procedure 2
etc etc
-----Original Message-----
Hi Angelina,
Looking at the code I think I would do it in the way I
have typed in directbeneath (so not tested or something)
This procedure you can make endless therefore.
I hope this solves your problem?
Cor
\\\
if Combobox1.text = xxx then
if myproc(textbox1, nothing) = true then
'run stored procedure 1
end if
elseif
if Combobox1.text = yyy then
if myproc(textbox2, textbox3) = true then
'run procedure 2
etc etc
////
\\\
Private Function MyProc (byval text1 as textbox, byval
text2 as textbox) asboolean
if Not text2 Is Nothing then
if text2.text ="" then
messagebox.show(error)
return false
end if
end if
if text1.text = "" then
messagebox.show(error)
return false
end if
return true
end function
///
what i want to do is to also include some nested if
statments to ensure that a message box is displayed if
any of the textboxes (Where the parameter is obtained for
the stored procedure) is empty.
I also wanted to know how to diplay a message if the
result of the sproc is empty.
any advise and help is appreciated.
thx in advance
.