473,383 Members | 1,801 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

increasing a declared integer by in a loop

in this case I have set up a recordset correctly, and I am trying to increase directno by 1 each time.
I thought simply directno= directno + 1 would work but it doesn't.
I have now tried this function - but again I can't get an increase past 1.
the message box is just to see whats going on.

Probably I am being silly but where am I going wrong please?? Any tips gratefully received

Dim directno as Integer
directno=0
With rstSupply
If Not .EOF Then
.MoveFirst
End If
Do Until .EOF
If !supplyTypeID = 1 Then
directno = inc(directno)
MsgBox (directno)
End If
.MoveNext
Loop
End With
rstSupply.Close
........
Function inc(ByRef data As Integer)
data = data + 1
inc = data
End Function
Dec 30 '17 #1
1 1347
Sorry everybody. The reason it didn't work was because I didnt put square brackets around the field. It was a false alarm

![transTypeID]- nothing to do with increasing the number
Dec 30 '17 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: build | last post by:
G'day All, I have a problem with this loop. There are a number of .txt files in 'myPath'. tmpFile = Dir(myPath & "\*.txt") 'PROCESS FOLDER Do Until tmpFile = "" <lottsa code> <too much to...
6
by: km | last post by:
Hi all, Why is it that the implementation of empty loop so slow in python when compared to perl ? #i did this in python (v 1.5) for x in xrange(1000): print x # this took 0.017 seconds...
14
by: Crimsonwingz | last post by:
Need to calculate a sum based on a number of factors over a period of years. I can use formula ^x for some of it, but need totals to carry over in the sum and have only been able to do this thus...
45
by: Trevor Best | last post by:
I did a test once using a looping variable, first dimmed as Integer, then as Long. I found the Integer was quicker at looping. I knew this to be true back in the 16 bit days where the CPU's (80286)...
38
by: Maarten | last post by:
hi all, how can i retrieve the type if a value inserted in an inputbox. what i want to do is make shure people only insert an integer type, if they don't they get an error message. ...
5
by: B. Chernick | last post by:
Is this a bug or just bad programming? I've never encountered this problem before. (Bare minimum sample form to illustrate.) I've also tried this with a class. Same result. The error is: For...
12
by: usa-99 | last post by:
Hi there I have following function which is called on load of page. function checkFieldContent(form) { var field; for(i = 0; i < form.elements.length; i++) { field = form.elements; if...
1
by: Semajthewise | last post by:
Hi all!! What I am trying to do today is write to a textfile then read from the file get some lines from that file and edit them. and re-write them to the file. Not replace I want the edited lines...
18
by: eman.abu.samra | last post by:
Hi all, i have encountered the strangest behavior. Check out this simple program: #include <stdio.h> int main() { double time = 1;
0
by: evilson | last post by:
Hi guys, can you help me with this, i have this subroutine in my mini program Public Sub tabla(ByVal rowX As Integer, ByVal colY As Integer, ByVal valueXY As String) Dim txt(,) As...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.