|
Hi,
I think there are at least two flaws:
1.
you should not compare for equality if CurrentDate=ReminderDate , since doing so
you might miss a reminder; you need to use an inequality.
2.
The reminder date depends on the order, so it MUST be calculated inside the ForEach loop,
using data pertaining to the current row.
Hope this helps.
|
|
|
|
|
Hi Luc,
Thanks for that, I can see what you're saying.
By having the reminder date outside the ForEach loop, it's not being read on each loop.
I've changed the code to
For Each dr As DataRow In Me.DachelDataSet.Invoices.Rows
ReminderDate = DateAdd(DateInterval.Month, 1, InvoiceDate)
If dr("Cleared") Is System.Convert.DBNull And ReminderDate = DateAdd(DateInterval.Month, 1, InvoiceDate) Then
If CurrentDate <> ReminderDate Then
Else
msgbxReminder = MsgBox("The Invoice for" & " " & CurrentClient & " " & "which is Invoice Number " & " " & CurrentInvoiceID & " " & "is 1 month overdue.")
End If
End If
Next
End Sub
However, still getting stuck on 2nd row of table.
Have I misunderstood something?
Thanks alot
Kris MCP
|
|
|
|
|
KrisnNala wrote: If CurrentDate <> ReminderDate
you made it worse!
equals is not good, since that only fores on one specific day, and your code may not run every day.
You need greater-equal.
And is InvoiceDate really the same for every order??? Try to focus a bit.
|
|
|
|
|
Hi Luc
Sorry getting tired but got to get the contract done.
You say use greater equals? Do you mean >=?
No InvoiceDate is definately not the same, although it can be.
Thanks for your help.
Kris MCP
|
|
|
|
|
KrisnNala wrote: ReminderDate = DateAdd(DateInterval.Month, 1, InvoiceDate)
If dr("Cleared") Is System.Convert.DBNull And ReminderDate = DateAdd(DateInterval.Month, 1, InvoiceDate) Then
The second half of the condition will always be true. You just set the variable to the same value that you are comparing it to.
KrisnNala wrote: If CurrentDate <> ReminderDate Then
Else
That is the exact same thing as an equality comparison.
What happens if the program is not run every single day? If the reminder date happens to be on the weekend, then on monday it will not be equal any more.
Use ReminderDate <= CurrentDate to get all invoices that has passed the reminder date.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
KrisnNala wrote: InvoiceDate = Me.DachelDataSet.Invoices.Rows(Me.InvoicesBindingSource.Position).Item("InvoiceDate")
You have to get the invoice date inside the loop, otherwise you will use the same invoice date for all records.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Hi Guff
Thanks alot for your help. Still have a problem that it's not moving through each row of the table. I know it's something really stupid I'm missing but getting annoyed with my self.
Code is now
Dim CurrentDate As Date
Dim ReminderDate As Date
Dim InvoiceDate As Date
Dim msgbxReminder As MsgBoxResult
CurrentDate = Date.Now.Date
For Each dr As DataRow In Me.DachelDataSet.Invoices.Rows
If dr("Cleared") Is System.Convert.DBNull Then
InvoiceDate = Me.DachelDataSet.Invoices.Rows(Me.InvoicesBindingSource.Position).Item("InvoiceDate")
ReminderDate = DateAdd(DateInterval.Month, 1, InvoiceDate)
If ReminderDate <= CurrentDate Then
msgbxReminder = MsgBox("The Invoice for" & " " & CurrentClient & " " & "which is Invoice Number " & " " & CurrentInvoiceID & " " & "is 1 month overdue.")
End If
End If
Next
Thanks Alot
Kris MCP
|
|
|
|
|
You still read the invoice date from the same data row eventhough you do it inside the loop. Read the invoice date from the data row dr instead.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Hi Guffa
Thanks alot for your help. All sorted.
Kris MCP
|
|
|
|
|
I have a solution with a couple projects in VB and CS with the following structure:
Solution: Utils.Net
VB proj: Utilities
CS proj: Utilities.Print
Is there a way to compile the entire solution into 1 .dll called utilities.dll. Is it possible to add all source files into one project and compile that project into a single .dll?
|
|
|
|
|
Each project should be able to compile individually. Do you have Utilities.Print reference to the utilities.dll that should be generated in the VB Project called Utilities? If so, everything ought to fall right in place.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
That's what I figured. I thought rather than have a utilities.dll and a utilitiesprint.dll (or referencing the Print class from the utils class), that they could be combined into a single .dll. Not a big deal, just curious if it could be done.
|
|
|
|
|
Maybe you can look into ILMerge for that.
|
|
|
|
|
I have an .ocx file made in vb 6.0 which i wanna use in vb.net 2.0
Could anyone plz tell me how to do that.
I have referenced it buti am not able to use the user-control which it contains.
|
|
|
|
|
Do you have a code example of how you are trying to accomplish this?
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
I have referenced it by:
Right-clicking the project--->add reference--->browse---> add.
It got added in my project but I am unable to usethe usercontrolthat it contains. How can I do this?
|
|
|
|
|
I want my grid to resize when form is resized but i want to use just anchor and dock properties of the grid.
i.e.
resolution 800,600
grid.location = covering 25% of the bottom part on the form remains
25% when it is maximized
Riaz Ahmed
0300-2668545
Software Engineer
DCCTechnologies
riaz.ahmed@dcc.com.pk
|
|
|
|
|
If u wanna full size of grid as form then u can try this
grid.Dock =DockStyle.Fill
Hope it will help U
Unless u don't give ur hundred percent whatever u r doning till there is no result of ur work...
|
|
|
|
|
If I'm understanding you correctly, the anchor property should accomplish this. Try clicking the different anchor points to see how the grid changes accordingly.
|
|
|
|
|
Can you pls help me in showing me how to slpit text after " " and show the text in messageboxes. Thank you.
txtNameSuname.Text = txtNameSurname.Text & txtSurname.Text & txtSurname & " " 'Enters a letter, number and space in Algorthim textbox
End Sub
|
|
|
|
|
Will the Split[^] function help?
|
|
|
|
|
Sorry I made a mistake in the syn text. Thank you
txtNameSurname.Text = txtNameSurname.Text & txtName.Text & txtSurname.Text & " "
|
|
|
|
|
Hi,
not sure what the second txtSurname is doing in that expression.
|
|
|
|
|
I saw that too and wonder. I think he fixed it in the post above yours.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
Hello all,
I am looking to make a run once installer for our clients that will update a few files and run a few scripts on a sql server database. I am looking to ask the user for the DB credentials (user name, pass etc.) This article:
here[^] seems to be kinda what I want but I was wondering, does this need to be attached to a project, or can it just have the basic functionality it needs?
|
|
|
|