L
Lasse T
Hi all !!
I hope someone are willing to help me explain something.
I have been playing around with Access for some time but when it comes to
VBA i am a total newbie. I get around by searching the web and Usenet when I
get stuck. Now I´m stuck again and I´m beginning to understand that I must
be missing something big when it comes to coding. I can figure out how to
add code to an objects events, for instant Click event of a button. or close
event of a form. When searching around I´m starting to see things like:
Place this code in your report module och place this code in the subform
control. What is this? Where are the report module? What is the subform
control?
I have an example. This code can solve my problem but I don´t know where to
place it. It is a quote from Jeff North:
My problem are similar to this. I have a form with three list boxes. I´m
marking one post from every list box and then klick a "search" button that
opens a new form based on a query. If the query are without result i do not
want the new form to open. Instead I want a message saying that there is no
data. I just can not figure out where to put the code.
If someone can point me in the right direction I would be very thankful.
Lasse T
-------------
I hope someone are willing to help me explain something.
I have been playing around with Access for some time but when it comes to
VBA i am a total newbie. I get around by searching the web and Usenet when I
get stuck. Now I´m stuck again and I´m beginning to understand that I must
be missing something big when it comes to coding. I can figure out how to
add code to an objects events, for instant Click event of a button. or close
event of a form. When searching around I´m starting to see things like:
Place this code in your report module och place this code in the subform
control. What is this? Where are the report module? What is the subform
control?
I have an example. This code can solve my problem but I don´t know where to
place it. It is a quote from Jeff North:
you can place the following code in your report module
Private Sub Report1_NoData(Cancel as Integer)
MsgBox "Sorry there is no data to print"
Cancel = True
End Sub
This simply tells the user that its no going to print anything (atleast the
button they clicked worked) and then closes the report (Cancel = True). If you
did not include this line then the report would still continue to process
Just a thought
My problem are similar to this. I have a form with three list boxes. I´m
marking one post from every list box and then klick a "search" button that
opens a new form based on a query. If the query are without result i do not
want the new form to open. Instead I want a message saying that there is no
data. I just can not figure out where to put the code.
If someone can point me in the right direction I would be very thankful.
Lasse T
-------------