| | |
VB6 find and replace
![]() |
•
•
Join Date: Oct 2009
Posts: 9
Reputation:
Solved Threads: 0
Hello everybody,
I have an issue with a code. I'm don't know how to start this.
Here is my problem:
Column 2 of my MSFlexgrid = store number. Ex: 1009,1010 etc.
In column 20 of my MSFlexgrid = Delivery day. Ex: Sun, Mon, Tue......,
Now if store 8009 have multiple delivery days ex:
The logic will have to be that way:
If the the holiday entered in the Form4.day_ferier (Combo Box) is "Mon"
Then it will calculate how many day it will have until the next delivery.
In that case,Monday to Friday = 4 days.
Then it will calculate how many days there was from the previous delivery. Friday to Monday = 3 days.
So since Monday to Friday is bigger that Friday to monday, then the results will be Monday +1. So Tuesday.
If the result would of been less, then it would of been Monday - 1. So Sunday.
If it would of been equal, by default, it would be Monday - 1.
Would it be easier if I change Sun by "1", Mon by "2", Tue by "3" and so on...
Thank you so much for your help.
I have an issue with a code. I'm don't know how to start this.
Here is my problem:
Column 2 of my MSFlexgrid = store number. Ex: 1009,1010 etc.
In column 20 of my MSFlexgrid = Delivery day. Ex: Sun, Mon, Tue......,
Now if store 8009 have multiple delivery days ex:
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
Column 2 Culumn 20 1009 Mon 1009 Fri
The logic will have to be that way:
If the the holiday entered in the Form4.day_ferier (Combo Box) is "Mon"
Then it will calculate how many day it will have until the next delivery.
In that case,Monday to Friday = 4 days.
Then it will calculate how many days there was from the previous delivery. Friday to Monday = 3 days.
So since Monday to Friday is bigger that Friday to monday, then the results will be Monday +1. So Tuesday.
If the result would of been less, then it would of been Monday - 1. So Sunday.
If it would of been equal, by default, it would be Monday - 1.
Would it be easier if I change Sun by "1", Mon by "2", Tue by "3" and so on...
Thank you so much for your help.
Last edited by wilder1926; 29 Days Ago at 8:32 pm.
•
•
Join Date: Oct 2009
Posts: 9
Reputation:
Solved Threads: 0
0
#3 28 Days Ago
What i did for now if to convert the days for numbers:
After, i tried something like:
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
For i = 8 To Form3.MSFWindows.Rows - 1 If Form3.MSFWindows.TextMatrix(i, 20) = "Sun" Then Form3.MSFWindows.TextMatrix(i, 20) = "1" End If If Form3.MSFWindows.TextMatrix(i, 20) = "Mon" Then Form3.MSFWindows.TextMatrix(i, 20) = "2" End If If Form3.MSFWindows.TextMatrix(i, 20) = "Tue" Then Form3.MSFWindows.TextMatrix(i, 20) = "3" End If If Form3.MSFWindows.TextMatrix(i, 20) = "Wed" Then Form3.MSFWindows.TextMatrix(i, 20) = "4" End If If Form3.MSFWindows.TextMatrix(i, 20) = "Thu" Then Form3.MSFWindows.TextMatrix(i, 20) = "5" End If If Form3.MSFWindows.TextMatrix(i, 20) = "Fri" Then Form3.MSFWindows.TextMatrix(i, 20) = "6" End If If Form3.MSFWindows.TextMatrix(i, 20) = "Sat" Then Form3.MSFWindows.TextMatrix(i, 20) = "7" End If Next i
After, i tried something like:
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
Dim i% For i = 8 To Form3.MSFWindows.Rows - 1 opid = Form3.MSFWindows.TextMatrix(i, 1) Day1 = day_ferier.Text For Each opid In Form3.MSFWindows If Form3.MSFWindows.TextMatrix(i, 20) = Day1 And Form3.MSFWindows.TextMatrix(i, 1) = opid Then Form3.MSFWindows.TextMatrix(i, 20) = Form3.MSFWindows.TextMatrix(i, 20) + 1 End If Next Next
•
•
Join Date: Jan 2008
Posts: 247
Reputation:
Solved Threads: 35
0
#4 27 Days Ago
It seems you have a problem in solving date/Times solutions.
What exactly do you want to achieve with your code? I presume that the result should show up in your datagrid?
Do you want to run reports from certain dates etc? or wouyld you like vb6 app to calculate the next dekivery date?
What exactly do you want to achieve with your code? I presume that the result should show up in your datagrid?
Do you want to run reports from certain dates etc? or wouyld you like vb6 app to calculate the next dekivery date?
Please mark questions as answered when done.
Be the ONE!!!
Be the ONE!!!
•
•
Join Date: Oct 2009
Posts: 9
Reputation:
Solved Threads: 0
0
#5 27 Days Ago
•
•
•
•
It seems you have a problem in solving date/Times solutions.
What exactly do you want to achieve with your code? I presume that the result should show up in your datagrid?
Do you want to run reports from certain dates etc? or wouyld you like vb6 app to calculate the next dekivery date?
Do you want to run reports from certain dates etc? No reports will be run.
would you like vb6 app to calculate the next delivery date?
Yes, It must calculate the delivery day that need to be modify, and replace it in the flexgrid. But replace only the day that need to be modify.
Thanks
Last edited by wilder1926; 27 Days Ago at 6:29 pm.
•
•
Join Date: Jan 2008
Posts: 247
Reputation:
Solved Threads: 35
0
#6 27 Days Ago
Where is your grid getting its data from? You will probably have to play around with vbdate functions.
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
If Form3.MSFWindows.TextMatrix(i, 20) = "Sun" 'vbSunday Then Form3.MSFWindows.TextMatrix(i, 20) = "1" 'Try functions like vbSunday, vbDate etc. End If
Please mark questions as answered when done.
Be the ONE!!!
Be the ONE!!!
•
•
Join Date: Oct 2009
Posts: 9
Reputation:
Solved Threads: 0
0
#7 27 Days Ago
I like your code, i really do but this part was not really my first problem.
My problem is more what i was saying in my first post:
If the the holiday entered in the Form4.day_ferier (Combo Box) is "Mon"
Then it will calculate how many day it will have until the next delivery.
In that case,Monday to Friday = 4 days.
Then it will calculate how many days there was from the previous delivery. Friday to Monday = 3 days.
So since Monday to Friday is bigger that Friday to monday, then the results will be Monday +1. So Tuesday.
If the result would of been less, then it would of been Monday - 1. So Sunday.
If it would of been equal, by default, it would be Monday - 1.
regards
My problem is more what i was saying in my first post:
If the the holiday entered in the Form4.day_ferier (Combo Box) is "Mon"
Then it will calculate how many day it will have until the next delivery.
In that case,Monday to Friday = 4 days.
Then it will calculate how many days there was from the previous delivery. Friday to Monday = 3 days.
So since Monday to Friday is bigger that Friday to monday, then the results will be Monday +1. So Tuesday.
If the result would of been less, then it would of been Monday - 1. So Sunday.
If it would of been equal, by default, it would be Monday - 1.
regards
•
•
Join Date: May 2009
Posts: 372
Reputation:
Solved Threads: 26
0
#8 22 Days Ago
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
If Form3.MSFWindows.TextMatrix(i, 20) = "Sat" Then Form3.MSFWindows.TextMatrix(i, 20) = "7" End If
If ALL my answers are wrong, only then will I read the question
•
•
Join Date: Oct 2009
Posts: 9
Reputation:
Solved Threads: 0
0
#9 21 Days Ago
•
•
•
•
I'm not familiar with flexigrid but if the grid was set to a day of the week could you not just change the setup to show the day number of the week?Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
If Form3.MSFWindows.TextMatrix(i, 20) = "Sat" Then Form3.MSFWindows.TextMatrix(i, 20) = "7" End If
That's good, it give's me an idea.
![]() |
Other Threads in the Visual Basic 4 / 5 / 6 Forum
- Previous Thread: VB6 database Help Required
- Next Thread: SQL command for calculating Ave from multiple tables
| Thread Tools | Search this Thread |
* 6 429 2007 access activex add age application basic beginner birth bmp calculator cd cells.find click client code college component connection connectionproblemusingvb6usingoledb copy creat ctrl+f data database datareport date delete dissertations dissertationthesis dissertationtopic edit error excel excelmacro file filename form hardware header iamthwee image inboxinvb internetfiledownload keypress label listbox listview liveperson login looping machine microsoft movingranges number objectinsert open oracle password prime program prompt range-objects readfile reading record refresh remotesqlserverdatabase report save search sendbyte sites sort sql sql2008 sqlserver subroutine tags textbox time urldownloadtofile vb vb6 vb6.0 vba visual visualbasic visualbasic6 web window windows






