Cant Seem To Get My Counters To Increment
Code: Option Explicit Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long) Dim strFileName As String Dim arrRawData() As String Dim strLine As String Dim numberOfLines As Integer Dim i As Integer
Private Sub cmdStart_Click() strFileName = "C:windowsdesktopTaskMyfile.dat" numberOfLines = openInputFile(strFileName) arrRawData = fillArray(numberOfLines) 'lblDisplay.Caption = numberOfLines End Sub
Public Function openInputFile(strFileName As String) As Integer Dim count As Integer Open strFileName For Input As #1 Do Until (EOF(1) = True) Line Input #1, strLine count = count + 1 Loop Close #1 openInputFile = count End Function
Public Function fillArray(count As Integer) As String() i = 0 ReDim arrRawData(count) Open strFileName For Input As #1 Do Until (EOF(1) = True) Line Input #1, strLine arrRawData(i) = strLine i = i + 1 Loop Close #1 fillArray = arrRawData() End Function
Variables i and count here.
Thanks for help!!!
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Regarding Counters
hello guys,
i hve one simple promblems regarding counters in vb6...i m writing a code which uses a counter...its working good when i run it using 'f5' when i created an exe of the project the problem is that everytime i start the exe it starts with 0...so pls tell me how to make it remember the value of counter while exiting the application.
Counters
have a look at this code,
Private Sub flagtimer_Timer()
While flagcounter < 19
If flag(flagcounter).Top + flag(flagcounter).Height > 850 Then
flagcaption = 20 + flagcounter
flag(flagcounter).Caption = flagcaption
flag(flagcounter).Top = 0
End If
If flagcaption > 20 Then flagcaption = flagcaption + flagcounter
flagcounter = flagcounter + 1
Wend
End Sub
it is for a flag which runs on the UP keypressed and acts as a flag thourghout the game, the value is increased everytime the flag goes down and appears above again, the prob is it will reach 38 and then the value will again be 20, i know where the prob is but i dun know how to fix it [img]images/icons/smile.gif[/img], can u help me? actually this flag is used to position an opponet car on a network as my game i snetwork based.
Counters!
i have made a maths program that randomises a sum, and randomises a symbol (+,-,*,/) which u then answer in a text box and a message appears telling you if its right or wrong, itf its right, that a new question is loaded. Now i need to count the number of first time correct and incorrect answers typed into the text box. it should also display the percentage of first time correct answers. how do i make vb count the number of times u get the answer right on the first time of trying????
Three Counters
Im making a program which schedules games to be played and then the outcome. However im having a few problems finalising some code.
Can anyone have a look at it please
Module:
Code:
Public Type Game
GameName As String
GamePlayedAgainst As String
GamePlayed As Boolean
GameWon As Boolean
End Type
Public Type Student
StudentName As String
StudentClass As String
StudentHouse As String
Game(1 To 4) As Game
End Type
Public Student(1 To 36) As Student
Form1;
Code:
Private Sub Command1_Click()
Dim strstuff As String
Dim counter As Integer
Dim countertwo As Integer
'Dim couterthree As Integer
'Dim counterfour As Integer
For counter = 1 To 36
Student(counter).Game(1).GameName = "Snap"
Student(counter).Game(2).GameName = "Cribbage"
Student(counter).Game(3).GameName = "Spilikins"
Student(counter).Game(4).GameName = "Junior Scrabble"
Next
For counterthree = 1 To 36
If Student(counter).StudentHouse <> Student(counter).StudentHouse Then
Text1.Text = "Error"
End If
Form1.Print ""
For countertwo = 1 To 4
With Student(counter)
strstuff = strstuff + "Game 1:" + .Game(counter).GameName
Form1.Print "Game Name: "; Student(counter).Game(countertwo).GameName
Form1.Print "Played Against: "; (countertwo); GamePlayedAgainst
Form1.Print "Played: "; Student(counter).Game(countertwo).GamePlayed
Form1.Print "Won: "; Student(counter).Game(countertwo); .Game
Form1.Print ""
End Sub
The form1.print lines are what is not working. Can anyonehelp out?
Counters
Do counter have to be in loops to work?
Help With Counters Please.
In my program i need to make a counter to be incremented indicating how many times the customer has purchased from me in the past . the counter should go in the customer.txt file right next to txtZip. I have no idea on how to do this could someone help and try to explain it to me. thanks. i will
Private Sub Open_Files()
Open "a:Orders.txt" For Append As #1
Open "a:Customer.txt" For Append As #2
End Sub
Private Sub Close_Files()
Close #1
Close #2
End Sub
Private Sub Write_Orders()
Write #1, cboProduct, txtQuantity, lblPos
Write #2, txtFirstName, txtLastName, txtMiddleInitial, txtPhoneNumber, txtZip
End Sub
Help With Counters
first time poster, I hope this is detailed enough...and in the right forum.
I am trying to get create a voting tool that will execute X times. I then want to display the number of times the items were voted for and the percentage of X they were voted for. So far everything is ok...but I can't get the program to recognize the last click of the vote command (in this case 10)
So as long as counter is not 10 the user can still vote, but once 10 is reached the results are displayed. Except in my case when the label captions are displayed I am one vote short, but the percentages add up.
I have counter = 0 in the form load.
then in the sub I have:
"If counter <> 10 Then"
counter = counter + 1
(code)
"end if"
I appreciate any help I can get with this...this may be fairly easy for some of you, but it's kiling me.
Counters
I think theres a bug in VB because I do counters as every one else but mine never work. Or maybe im missing somthing if so whats wrong?
Private Sub Command3_Click()
Dim TopS(3) As Integer
Dim TopN(3) As String
Dim counter As Integer
TopS(0) = "123"
TopS(1) = "13"
TopS(2) = "555"
Label3.Caption = TopS(counter)
counter = counter + 1
End Sub
VB Counters !
Hello all,
i was just wondering if a counter (like the ones on a website) can be put on a Visual basic form. i need the counter to tell me(log) how many times the form had been opened/viewed, if possible who the user and how many times.
Does anyone have the source code or a link to such vb counter. Any help is highly appreciated. Thanks
Counters
If I put count = count + 1 into a sub (outside of a loop) and try to call the sub again, after it is done, will count=2?
(Basically, do variables reset themselves after the sub they are in have run?)
Counters...?
Hi everyone!
My problem is somewhat complicated today...
I'm writing a program that will be used by a local highschool fo their textbooks. I've realized that it would be too much wor for someone to sit down and enter all the textbook informatio for each and every textbook in the school. This is why I'v decided to create a "Master" textbook for which all th information is entered and then to have a button tha "generates" the copies. I have managed to do this, except fo one tiny problem... Each copy of a particular textbook must hav a copy number, (eg. 1,2,3..10 etc.), but if i try to generat more copies of that particular textbook, the copy numbers star at 1 again. How do I check the last copy number in the [Textboo Copy] table and continue numbering the copies from there? Thi is the code that i have tried, but i get a type mismatch error:
Set rstTxtCopy = dbs.OpenRecordset("Textbook Copy")
If rstTxtCopy.BOF = False Then
With rstTxtCopy
.MoveLast
copyCount = ("Select [copy_#] from [Textbook Copy] wher [isbn#] =" & dsTextMast.Recordset![isbn#]) + 1
End With
Else
copyCount = 1
End If
If anyone understands what I am trying to do and can help me i any way I would be eternally grateful! :-)
Thanks
Gwyn
Counters + Labels
hey,
for my game, i need to have it so that when the user shoots a bullet and hits the other user, he/she gets a point. (1 points adds to his/her label)
here is my attempt to it:
Private Sub Timer1_Timer()
Dim Counter As Integer
Dim Index As Integer
Counter = Counter + 1
Lbullet(0).Visible = True
Lbullet(0).Left = Lbullet(0).Left + 300
For Index = 0 To 1
If Lbullet(0).Top >= Image2.Top - Lbullet(0).Height Then
If Lbullet(0).Top <= Image2.Top + Image2.Height Then
If Lbullet(0).Left <= Image2.Left + Image2.Width Then
If Lbullet(0).Left >= Image2.Left - Lbullet(0).Width Then
Label2.Caption = Counter
End If
End If
End If
End If
Next Index
End Sub
i think the collision aspect of it should be right but the counter sections for the labels is wrong.
Automatic Counters
hi, i have a program that needs to have a counter that adds 1 to a number at set intervals. Also i need the form to continuously update or check this piece of code constantly. i have the following code
Code:
Dim i As Integer
Dim t As Integer
t = frmMain.Label1.Caption
If mouseover Then
Do Until t = 30
For i = 1 To 10000
DoEvents
Next i
repeat
is this code correct?. in line 4 the code mouseover i was told that a code or similar to this was used so that if the mouse was over hte form i could uses that to trigger the turns generator
please advise
much apprecieated
Decalring && Using Counters
In a command button i have
Code:
Dim YelowPoints As Integer
Dim GreenPoints As Integer
YellowPoints = 0
GreenPoints = 0
'More code here Adding to the counters
Buti want to press the button more than once to add more points / increment the counter but everytime i click the mouse, it resets the counter back to 0 as the above decalration shows. Any idea's? cheers
Adding With Counters
Im trying to Add to two counters, depending on a statement.
Here is what i have:
Code:
Private Sub Command1_Click()
Dim YellowPoints As Integer
Dim GreenPoints As Integer
For YellowPoints = 1 To 36
For GreenPoints = 1 To 36
YellowPoints = 0
GreenPoints = 0
If Student(CompetitorNum).StudentHouse = "Yellow" & Combo1.Text & Combo5.Text = "Yes" Then
YellowPoints = YellowPoints + 1
End If
If Student(CompetitorNum).StudentHouse = "Green" & Combo1.Text & Combo5.Text = "Yes" Then
GreenPoints = GreenPoints + 1
End If
Next
Next
Label16.Caption = YellowPoints
Label17.Caption = GreenPoints
End Sub
When i run this, i get a type mismatch. Is there any obvious reason for this?
Two Counters In A For Loop?
Code:
For i = 0 & counter1 = 1 To UBound(strarray)
strarray(i) = ListViewPrint.ListItems(counter1).SubItems(1)
Next i, counter1
self explanatory? i just want to use two counters as they are initialized by two different values, the error is:
"next witout for loop" or something along those longs.. basically telling me that the comma and counter1 need another for statement?
thanks
Loops And Counters
On my form I have 4 combo boxes:
cboPlyr1(0)
cboPlyr2(0)
cboPlyr3(0)
cboPlyr4(0)
The reason I have them with index zero is because later on when I add more tabs (sstabs) dynamically I will be copying the combos so the index will increase. These combo boxes are filling with the player names that are in a database. What I am hoping to do is create a counter that will allow me to loop through the code incrementing the cboPlyr number.
So I'm hoping for the code to look something like this:
Code:
Do Until x > 4 'x will be used for the number of combo boxes on the form
With adoPlyrName(g_adoCtr).Recordset
Do Until .EOF
'This is where I would like to use "x" to increment the
'number in the cboPlyr so that I don't have to write code
'for each combo box
cboPlyr1(g_adoCtr).AddItem !l_name & ", " & !f_name
If .EOF = True Then
Exit Sub
Else
.MoveNext
End If
Loop
End With
x = x + 1
Loop
Does anyone know how to include a variable in that part of the loop? I tried putting "x" in there a few different ways but keep getting error messages. Any help with this is greatly appreciated.
Counters On A Form
can some one tell me if it is possible to have a counter on a form so that everytime the program is loaded it goes up by one number...and if so can you tell me the code....thanks
Excel And Counters
How do I create a repetition for x number of loops and move the information entered into the boxes to cells down a column.
E.G. I need 10 loops and information entered in text1.text
in the first loop goes in cell A1
in the second loop goes in cell A2
in the third loop goes in cell A3
etc..
Any help would be greatly appreciated as it is for a major assessment and is essential to the entire program
Thanks Dave
Please Help With Counters And Accumulators
On this particular assignment, I'm required to find the largest population and smallest area size of a country from a txt file. The txt file consist of 233 country, including the capital, area, and the population. I used counter to find out the total number of countries from the txt file but how do I go about coding to display the country with the highest population and the country with the lowest area size. I already know by looking at the list China has the most population. Here is my coding so far.
Private Sub cmdListWorld_Click()
Dim country As String, Capital As String, World As String
Dim Area As Double, population As Long
Dim count As Integer, sum As Single
lstWorld.Clear
count = 0
Open "A:WorldData2002.txt" For Input As #1
Do While Not EOF(1)
Input #1, country, Capital, Area, population
World = Format(country, "@@@@@@@@@@@@") _
& Format(Capital, "!@@@@@@@@@@@@@@@") _
& Format(FormatNumber(Area), "!@@@@@@@@@@@") _
& Format(FormatNumber(population, 0), @@@@@@@")
lstWorld.AddItem (World)
count = count + 1
Loop
Close #1
picOut.Cls
picOut.Print "The total number of countries: "; count
picOut.Print "China has the largest population with ";
Getting Performance Counters In VB6
I Need to access the performance counters in VB6. From what I can see I have to include a windows API - Anyone know which API I need for htis?
Thanks in advance
Stu
Extensible Counters And VB
I am writing a .vbs script to query our webservers, show the web name, and allow the admin to stop and start the individual webs. I would also like to query the IIS counters via the script to show how many total anonymous users are connected. Has anyone done anything like this before. Any sample code?
Recordset Counters
I would like to add a new record to a database and have a line Record ? out of ??? where ? is the current record and ??? is the
total number of records. Can this be done without hardcoding? Can the counters be turned off when adding a new record?
My Own Performance Counters
Hi there!
Can someone please help me with code or information on how to add my own performance counters to NT's using VB code? I've been struggling with this for some time now.
Negative Numbers In Counters
hey guys, im running into a little problem with my code. for some reason this only occurs if the numbers under evaluation are negative.
when i use the code like this...
Code:
g = Sheets("RawData").Range("g4").Value + 4
Cells(g, 11) = Cells(g, 4)
''For counter5 = 1 To 12
'' For counter4 = 4 To 10
'' Cells(g, 11) = Cells(g, counter4)
'' If Cells(g, counter4) > Cells(g, 11) Then Cells(g, 11) = Cells(g, counter4)
'' Next counter4
''g = g + Sheets("RawData").Range("g4").Value
''Next counter5
End Sub
cell(g,11) displays the value cell(g,4)
but when i use the code like this...
Code:
g = Sheets("RawData").Range("g4").Value + 4
''Cells(g, 11) = Cells(g, 4)
For counter5 = 1 To 12
For counter4 = 4 To 10
Cells(g, 11) = Cells(g, counter4)
If Cells(g, counter4) > Cells(g, 11) Then Cells(g, 11) = Cells(g, counter4)
Next counter4
g = g + Sheets("RawData").Range("g4").Value
Next counter5
End Sub
it doesnt display the value. I am stuck on this one guys.
Helps With Counters In VB6 And Averages
I have data which is entered into 4 boxes, a button is pressed and calculations on each box are performed.
The data is then shown in a sub value textbox, VAT textbox, a 'discounts' texbox and a total value textbox.
I then click a button called 'new data' and the current data is wiped and the form is afresh again to add more data.
I need to make it so that every time I click 'new data' specific parts of the data on the form are saved on another form, and each textbox is incremented each time the 'new data' button is clicked and the new data is added to its specific place on the new form.
I also need to calculate the average value of a variable, how do i do that? keep in mind its vb6
I'm guessing I need to use counters for this, any ideas people?
Thanks!
How Can You Access The System Counters - Such As CPU And Mem Usage, Dl/ul Speed, Etc?
anyone know how to access these counters, and add them to a VB app?
theres the sysinfo control, but is there any api or anything to make this less bulky? also, how can you get the values of a certain counter? (the control seems to just add the values within itself, not usable to be put in a string or something)
an example is www.winbar.nl ..
its written in VB
how can you access these counters?
Txt Increment
Hi,
Does anybody have any ideas on how I could achieve the following
I would like to Increment Letters. E.g
If I type A to D
Then it would return A, B, C, D,
Thanks in Advance
Pawel Humanski
How To Increment This And Use Ado?
Hi guys I need to display these data in array buttom like this
1 to 6 Display data 1 to 6
7 to 12 the same for this..
13 to 15 the same for this...
Code:
declare @startRow int;
declare @pageSize int;
set @startRow = 1;
set @pageSize = 6;
select FirstName, LastName
from (
select row_number() over(order by LastName) as [RowNumber],
FirstName, LastName
from Person.Contact
where LastName like 'D%') as Derived
where RowNumber between @startRow
and @startRow + @pageSize - 1;
Elvis Cabral
Increment
Hi!
The form name is binaryform7 in the attachment.I want that:
1)The value of parameter count shud be incremented to 1 when clicked on NEXT PARAMETER
When i typed the following code in the button of NEXT PARAMETER click event,it gave me a surprising output...i am definately wrong but pls correct me
VB Code:
For i = 1 To Combo1.ListCountText3.Text = i + 1Next i
2)There are 2 combo boxes.1 is CALCULATION MODEL and the other is SELECTED PARAMETERS
We can select multiple values from the CALCULATION MODEL and those selected only will appear in the other combo box.
3)The no. of values into the CALCULATION MODEL,till that number of times only will the parameter count increment.
For example,If the number of values in Calculation model is 15,the parameter count will maximum be incremented till 15 not more than that.
Pls help!
Thnx!
Increment Value
I have a table with TransactionID field (Number Data type) I dont like to use AutoNumber.
I also have a textbox and a button in my form. During run time I will check whether the transactionID field has a value by clicking New button. If there's no value (which of course at first table is empty) I assigned a value to it which will then be displayed in the textbox and the same value will be INSERTED/save when i click a save button.
The problem is when i click the New button 1 is added to the existing record. the third time and so on i click the New button. The value is now not incrementing, it is stuck to 2.
My code:
VB Code:
Dim rsCashSales As New ADODB.Recordset sSQL = "SELECT TransactionID FROM tblCashSales" If rsCashSales.State = adStateOpen Then rsCashSales.Close rsCashSales.Open sSQL, oConn, adOpenStatic, adLockOptimistic If rsCashSales.EOF = True Then txtTransactionID.Text = 1 Else txtTransactionID.Text = CLng(rsCashSales.Fields("TransactionID")) + 1 End If sSQL = "INSERT INTO tblCashSales (TransactionID,Cashpayment) VALUES " & _ "('" & txtTransactionID.Text & " ','" & CCur(txtAmountDue.Text) & "')" oConn.Execute sSQL
What's wrong with my code?
Increment One Day
Quick question:
I have
VB Code:
txt_Date.Text = Date.Now.Today()
and want to increment/decrement 1 day based on whatever today's date happens to be. How would I go about doing that?
Thanks-
m
Txt Increment
Hi
I would like to know how would I be able to perform a txt Increment.
Eg if the User types A to D
The program would display A, B, C, D
Or AA to BB
Would display AA, AB, BB
Thanks in Advance
Humanski
Increment
This is gonna stupid but is there and Increment function in VB? that will inc any integer var by another integer or just 1.
thanx
How To Increment This
Hi
here is the formula I use:
For Each cl In Worksheets("SHEET2").UsedRange
Worksheets("SHEET3").Cells(cl.Value, cl.Column) = "1"
Next cl
this is what it does:
sheet 2
A1) 5
A2) 3
A3) 7
it converts the data to this
sheet 3
A3) 1
A5) 1
A7) 1
the problem is if I have :
sheet 2
A1) 2
A2) 2
A3) 3
converts the data to this:
sheet 3
A2) 1
A3) 1
I need it do this:
A2) 2
A3) 1
any ideas ? (the sheets are excel worksheets if it matters)
thanks
lrneilson
How Would You Do Something Like This? (Increment)
Hey everyone.
I think I may be getting in over my head, but hopefully I wont have the stare when all is done.
In the screenshot you can see the general layout
What I have so far is
Code:Private Sub Command1_Click()
Dim vTempLine As String
vTempLine = Chr(34) & Text1.Text & "$$bind_load_file " & Text5.Text & Chr(34)
List1.AddItem vTempLine
End Sub
This works great for Text1.
What I need to is, when I click > it goes to each text box and adds the path to each piece of text then drops it into the list box. If that wasnt enough I also need to increment the text file.
So Test.txt would become Test1.txt etc...
And the 100$ questions: How would I go about something like this?
Edited by - Logan 5 on 6/21/2004 10:58:59 AM
Variable Increment By Itself
Hi fellows,
I know this may seem like a stupid question, but I have tried several ways to get it to work, but with no luck.
here is my code below, before I explain the problem:
Code:
Private Sub btnCalculate_Click()
Dim a As Integer
Dim b As Integer
Dim c As Integer
Dim d As Integer
Dim e As Integer
Dim f As Integer
Dim g As Integer
Dim h As Integer
Dim ti As Integer
Dim nsteps As Integer
Dim td As Long
Dim pd As Long
Dim Qg As Long
Dim hh As Long
a = CInt(txtRop.Text)
b = CInt(txtKg.Text)
c = CInt(txtPhi.Text)
d = CInt(txtCp.Text)
e = CInt(txtMui.Text)
f = CInt(txtRw.Text)
g = CInt(txtPf.Text)
h = CInt(txtPwf.Text)
ti = CInt(txtTimeSteps.Text)
nsteps = CInt(txtSteps.Text)
Dim x As Integer
Dim i As Integer
For i = 0 To (nsteps - 1)
td = (7.324 * 10 ^ 8) * ((b * ti) / (c * d * e * (f ^ 2))) ' td
pd = 0.5 * (Log(td) + 0.81) 'pd
hh = a * ti ' hh
Qg = ((b * hh) / (50.35 * e)) * ((g ^ 2 - h ^ 2) / (pd * h)) 'Qg
lstData.AddItem (CStr(Qg)) + vbTab + vbTab + (CStr(hh))
lstTi.AddItem (CStr(ti))
x = ti ' Thought I could use these 2 lines to do it,
ti = x + ti ' but with no luck
Next
End Sub
basically I have a form in which the user can enter several numbers, on the click of the button, then a calculation is made, and the results of two final values Qg and hh are listed in the listbox as can be seen above. However I need the variable ti to increment by itself based on the value entered by the user in its associated text field. For example if someone enters 12, I want it to increment itself like 12, 24, 36, 48 etc.. With what I currently have, it just doubles itself each time. I have tried several methods and thought this one would work, but they all just double the variable instead of incrementing it by itself.
P.S. I used the second listbox lstTi just to monitor the value of the variable ti
I would appreciate some assistance with this matter.
Thanks
For Next Loop Increment
I want a For next loop that increments by 5 instead of one:
Code:
For j = 5 to 200
'CODE
Next
I want the j to go 5, 10, 15, 20, 25, ect. Is there an increment command to do this?
Thanks
Auto Increment
I have a form that I want to have a number in a textbox for example increment every time the user clicks a command button. I know how to do this, but when the application closes the number gets reset. Textbox.text=103 is at the start. When the user clicks it goes to 104 etc. If the application is closed, I want the number to remain as 104 and whne it is opened again and the user clicks, the number will change to 105 etc.
Thanks
Can You Increment A Variables Name?
I have a situation where I have say 40 variables with the names
Con1, Con2, Con3
Is there a way that I can change which variable I am writing to using an integer value behind the con
i.e.
dim lngNumber as long
Con & lngNumber
lngnumber=lngnumber+1
Thanks
Increment And IP Address
I am very new to programming and am looking to write an app to scan all our pc on the LAN to retrieve software that's installed on the and some simple info about the system.
I have most of it working, but would like to be able to use a Start IP address and an End IP Address and scan everything in between.
Unfortunatley I have no idean how to do this. I found the inet_addr() funstion that converts an IP address in the form 127.21.0.87 to a number and the inet_ntoa fuction to convert back to the IP address. The thing I need to do is increment the IP address each time around;
e.g.
Start at 10.0.0.1
End at 10.0.2.255
And scan everything in between.
this has been annoying be for a week now without any sucess, so if anybody can help I'd be grateful.
thanks
Increment Problem
I have created the following code that will Increment numbers that users specify, The only problem that I am having is I cant get it too work when I put a number larger then 10 in because it automatically adds a "0" I have tried to sort this problem but cant seem to figure out the correct way, can anybody help!!
Private Sub CmdGenerate_Click()
Dim i%, j%, k%, UBoundIndex%, UBoundIndex1%, UBoundIndex2%, UBoundIndex3%, UBoundIndex4%, UBoundIndex5%
Dim RetVal
List1.Clear
UBoundIndex = InputBox("Enter First From Column Number.", "Counter")
UBoundIndex1 = InputBox("Enter First To Column Number .", "Counter")
UBoundIndex2 = InputBox("Enter Second Column Number.", "Counter")
UBoundIndex3 = InputBox("Enter Second To Column Number.", "Counter")
UBoundIndex4 = InputBox("Enter Third Column Number.", "Counter")
UBoundIndex5 = InputBox("Enter Third To Column Number.", "Counter")
For i = UBoundIndex To UBoundIndex1
For j = UBoundIndex2 To UBoundIndex3
For k = UBoundIndex4 To UBoundIndex5
If UBoundIndex < 10 Then
List1.AddItem "" & i & "-" & "" & j & "-" & "" & k & "," & List1.ListCount
If UBoundIndex >= 10 Then
List1.AddItem "0" & i & "-" & "0" & j & "-" & "0" & k & "," & List1.ListCount
End If
End If
Next k
Next j
Next i
Increment Function
i cant find an increment function in vb6. so i tried to write my own:
private function inc(byref var as integer)
var = var + 1
end function
but it does not work, why?
sorry if its a really n00b question
Auto Increment
hi all experts,
I have 4 different tables in MS-ACCESS.
i'm doing project for an engineering company. So they have different jaws for CNC machines. like OD DIAMETER, ID DIAMETER, MULTIPLE OD DIAMETER and MULTIPLE ID DIAMETER
i want to keep track of each issue of jaws to the worker......
so my question is that can i get one receipt number which is AUTO INCREMENT......and that will be unique for each issue of jaw.......is it possible to track 4 tables for AUTO INCREMENT of the receipt number.....
i think i'm clear in describing my question.........
need help
sachin
Increment Values
Is there a way to number the records and grab that value? For example, If I have "Select store, sales from SalesOrders order by sales desc" that I display in a grid. I want to diplay what number each record is. Is there a way to create and return those number in sql?
I know there are ways to create the numbers in vb but I really want it in my sql statement
Increment Field In Db...
hello...im trying to do a simple increment using access and vb6...on form load i set the connection to the db and created a select case function that would read the number of a field in the table...if its case 0 --> lblweek.caption = "Week 1" and so, up to "Week 10"...
i want to increment that single field in the table by clicking a button (send)...how is this possible?...thanks for your help...
Automatic Increment
Hi,
I am new to database programing and have this problem I can't find an answer to. This is the code I am using.
Code:
Set conData = New ADODB.Connection
conData.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & App.Path & "data.mdb"
strSQL = "CREATE TABLE League (" & _
"ID Integer NOT NULL IDENTITY(1,1) PRIMARY KEY," & _
"LeagueName Varchar(50)," & _
"BowlingCenter Varchar(50));"
conData.Execute strSQL
Set conData = Nothing
However when I add data the ID (primary key) does not increment. All my ID's are 1.
What am I doing wrong?
Thanks for your help.
Increment A Date
Hello,
I have an app that has an odbc connection to an access database. In that databse I have a date field, but at a certain time I want to increment that date field in 12 days.
For example, if the date is 1-9-04, it goes to 13-9-2004.
How can I do that?
Thanks in advance...
|