|
You need to read the documentation. Isnull returns true or false, depending on if the value is null or not. It takes one arguement, not two. You should RTFM instead of just guessing.
Unfortunately, Nz appears to be the function that you should use in Access in place of Coalesce, which is what you're really trying to do. However, Nz evaluates if something is zero, not null. So, that could be why you had an error in the first place. I don't use access, I found all this out with a tiny bit of googling. What you need is an equivelant to the ? : syntax in C#, which I think is Iif in VB.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Christian Graus wrote: You should RTFM instead of just guessing.
hi Mr genius,
i didn't introduce isnull as an alternative to nz it was Mycroft Holmes, & it doesn't need manuals to understand what it does it looks like it returns Boolean Is??? NULL?? yes NO?? intellisense in vb.net anyway shows you that it is not a big research FYOFK
here is a small SCIENTIFIC DEMONSTRATION video for you to prove you WRONG that ms access is not throwing the exception, the query runs fine in access.
http://www.youtube.com/watch?v=6KhWMcSf_ys
UNLIKE SOME PEOPLE I KEEP MY MOUTH SHUT WHEN I DON'T KNOW ABOUT SOMETHING.
in case you don't believe it:
HERE IS THE SOLUTION DOWNLOAD IT & EXPERIMENT WITH IT YOURSELF, data.accdb is the access & i guess you know how to open a vb.net solution.
http://www.coderisland.com/query_testing.zip
now Please, if your scientific is going to be girl talk do not waist my time,
if your scientific, i challenge you.
Share your knowledge it's one way to achieve immortality
http://www.rabihtawil.com
http://blog.rabihtawil.com
http://www.coderisland.com
|
|
|
|
|
If this is a copy'n'paste version of your exact code, line for line, then you've got a problem. VB.NET doesn't (until 2010 anyway) do automatic line continuation. So, if you're seeing VB.NET throw up these errors, you have to reformat your SQL string like this:
my query1 = "SELECT Inventory.Inventory_Id, Inventory.Inventory_description, " & _
"Inventory.Inventory_stock_count, nz((SELECT Sum(Order.item_qty) AS SumOfitem_qty " & _
"FROM [Order] " & _
"WHERE Order.From_date<=Date() AND (Order.To_date)>=Date() AND Order.Item_ID=""I"" & " & _
"Inventory.Inventory_Id),0) AS CurrentlyOut, " & _
"[Inventory_stock_count]-Nz((SELECT Sum(Order.item_qty) AS SumOfitem_qtyFROM [Order] " & _
"WHERE Order.From_date<=Date() AND (Order.To_date)>=Date() AND Order.Item_ID=""I"" & " & _
"Inventory.Inventory_Id),0) AS NetHereFROM Inventory"
Learn how VB.NET handles string literals before you start bashing other people for their "lack of knowledge", Mr. Genius.
|
|
|
|
|
Dave Kreskowiak wrote: VB.NET doesn't (until 2010 anyway)
hahaha yes it does in vs 2010 correct your knowledge download it & try it
your copy paste is irrelevant because i wrote it on one single line,
when i call you mr genius Mr mvp i am too humble to accept that title from you so keep it for yourself
Share your knowledge it's one way to achieve immortality
http://www.rabihtawil.com
http://blog.rabihtawil.com
http://www.coderisland.com
|
|
|
|
|
Say I wanted to create a small program that automatically rotated between websites every X seconds, where would I need to start? For instance, I create a simple form, it has 2 buttons. A start and a stop button. The stop button just quits the program completely, so I'm using the Me.Close() function for that, so I'm not worried about that. However, I want the start button to do something like.....open Google in Internet Explorer, and after say...45 seconds, rotate to Yahoo, and then another 45 seconds, rotate to MSN, and so forth and so on. Now, say I wanted the rotations to be less than 2 minutes, but more than 30 seconds, where would I start there? Would I use the Do/Loop functions?
|
|
|
|
|
This is trivial. Just use a timer.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
So glad this is trivial to an expert like yourself. However, being a beginner, the question still begs to differ. So, I go to using a timer, that's fine, but where do I begin? How do I launch the websites and make them rotate? Which function do I do? Obviously it won't be a Do-<whatever> function. Where would you suggest I start? And since it's trivial, let's do it this way. I want to make the timers connect to and then jump through using proxy. I.E., when the program is first launched, I want it to connect to a predefined proxy server and run through all the websites one time. Then on it's return path (or loop if you will), I want it to connect to a second predefined proxy server and have it run through the websites like that, so forth and so on. Any suggestions for that?
|
|
|
|
|
Have a list of the sites you want to visit in an arraylist, have an integer that will increment from 0 to arraylist.count-1, then put on a timer and set the interval to 45 seconds, then on the timers .tick event navigate to the url stored in arraylist(integer you are incrementing), increment integer.
I will try to post some code when i get the chance
|
|
|
|
|
Ok so i got the code done quickly
Add a webbrowser control, a timer, and a button. Set the timer at the interval you want.
If you want a stop button, just add one with Me.Timer1.Stop, thats it.
Public Class Form1
Dim siteCount As Integer = 0
Dim aList As New ArrayList
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
aList.Add("http://www.jmbundy.blogspot.com/")
aList.Add("http://www.codeproject.com/Messages/3244826/Re-Looping-Website-Viewer.aspx")
aList.Add("http://www.google.com/webhp?sourceid=navclient&ie=UTF-8")
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Me.Timer1.Start()
End Sub
Private Sub Timer1_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Me.WebBrowser1.Navigate(Me.aList(siteCount))
If siteCount + 1 <= Me.aList.Count - 1 Then
siteCount += 1
Else : siteCount = 0
End If
End Sub
End Class
|
|
|
|
|
This is a wonderful solution and is greatly appreciated. Now all I have to do is figure out how to make it jump through proxies. I'm wondering, could I use the GetStream() function to try and make it jump through proxies?
|
|
|
|
|
|
John, really great resources for reviewing! Thanks so much!
|
|
|
|
|
Hi,
Guys I need your guidance..
I have MdiForm with a progress bar. when I save on a child form, I want to have the progress bar to show the saving progress.
To be more clearer, when I click save_button on a child from, the bar should show progress and then reset after the saving method is done.
Thanks
|
|
|
|
|
Add a Statusbar to your MdiForm and show the progressbar on the statusbar when saving.
Tosch
|
|
|
|
|
Hi,
I have added statusbar to MdiForm also a progressBar..when I load a parent form from the MdiForm, on load event I also load the progressBar, it works, but when I save on a child form, I can't do it..
thanks advance
|
|
|
|
|
How to close all open forms without current and startup forms?
|
|
|
|
|
Get the list of open forms by Application.OpenForms collection. Then, identify the current form and the start up one from the list. Close the rest of them. You can identify current one by matching the name or something and same goes for the start up form.
It's not necessary to be so stupid, either, but people manage it. - Christian Graus, 2009 AD
|
|
|
|
|
Hi,
In my application - I need to search for installed SQL Server instances on the wotkstation or network; so I can create the appropriate connection string and also for allowing the user to install sql server express if no sql server is installed.
Is there any way?
Thanks,
Ekjon
|
|
|
|
|
Check out SqlDataSourceEnumerator class. That will help you getting the list of SQL server instances on the network.
It's not necessary to be so stupid, either, but people manage it. - Christian Graus, 2009 AD
|
|
|
|
|
u can use sqldatasourceenumerator to get the available sql instances
like
Dim dt As New DataTable
dt= Sql.SqlDataSourceEnumerator.Instance.GetDataSources
DataGridView1.DataSource = dt.AsDataView
|
|
|
|
|
Thanks d@nish and Dambod - it was very helpful.
|
|
|
|
|
Hi there,
I am currently trying to generate a report based on crystal report 10. In my report there are some parameters that should be displayed only once, some parameter for every record but some only a few times. Here is what i did, I put those parameters that will be
1. displayed once on the page headers
2. displayed for every record from the database in details section, and I used GROUPING for others.
Name____Col1_____Col2____Col3____Time
______________________________Dias_Horas_Minutos
SUBAREA_a
X____test____AAAA____AAAA1____1____2____3
Y____test____BBBB_____BBBB1____3____2____1
_____________________Subtotal____4____4____4
SUBAREA_b
X____test____AAAA____AAAA1____1____2____3
Y____test____BBBB____BBBB1____3____2____1
_____________________Subtotal____4____4____4
SUBAREA_c
X____test____AAAA____AAAA1____1____2____3
Y____test____BBBB____BBBB1_____3____2____1
_____________________Subtotal____4____4____4
_____________________TOTAL____12____12____12
My question is that possible to have a sub-grouping with grouping in Crystal report?
with regards,
modified on Wednesday, October 21, 2009 10:49 AM
|
|
|
|
|
Hello everyone
I am sure this is somting simple but i cant figuer it out
how you can you have a button click a button ???
say
when you click button 1 it will be like clicking button 2 button 3 at the same time ??
Thanks
Bob
|
|
|
|
|
Just call them;
Private Sub Button1_Click(sender As Object, e As EventArgs)
Button2_Click(Nothing, EventArgs.Empty)
Button3_Click(Nothing, EventArgs.Empty)
End Sub
I are Troll
|
|
|
|
|
Why not have a single handler for all the buttons? Then you can wisely put some conditions so that only a particular code is fired depending on the button clicked.
It's not necessary to be so stupid, either, but people manage it. - Christian Graus, 2009 AD
|
|
|
|
|