Congratulations to AcaCandy on her 100,000th post!
There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
 
Tag Cloud
acer black screen blue screen boot bsod computer connection crash css dell display drive driver drivers email error ethernet excel firefox firefox 3 game hard drive internet internet explorer itunes laptop linux malware monitor network networking nvidia outlook outlook 2003 outlook 2007 outlook express partition problem router slow software sound trojan usb video virus vista windows windows xp wireless
Software Development
Search
Search in:
 
Advanced Search
Tech Support Guy Forums > Software & Hardware > Software Development >
VB in access 2000


HELLO AND WELCOME! Before you can post your question, you'll have to register -- it's completely free! Click here to join today! We highly recommend that you print a copy of our Guide for New Members. Enjoy!

Closed Thread
 
Thread Tools
Erm's Avatar
Erm Erm is offline
Senior Member with 246 posts.
 
Join Date: Jul 2003
Location: UK
02-Feb-2004, 04:36 AM #1
VB in access 2000
I am creating some VB in an Access 2000 database to update a field. I want it to go through every record in a table and update a field until it reaches the end of the table. My theory was to do a loop something like this...

Private Sub cmdUpdateBilling_Click()
Dim result As Boolean

MoveFirst

Do While ?DON'T KNOW WHAT TO PUT HERE
If (BillingDate > Now()) Then
result = MsgBox("The billing date is already in the future. Do you still want to update it?", vbOKCancel)
If result = vbOK Then
BillingDate = DateAdd("m", [paymentperiod(months)], BillingDate)
Else
End If
Else
End If
MoveNext
Loop
End Sub

It is a while since I have done VB and I am rather sketchy!!!
__________________
Debs
AbvAvgUser's Avatar
Distinguished Member with 2,313 posts.
 
Join Date: Oct 2002
Location: Mumbai, India
Experience: Intermediate
02-Feb-2004, 07:44 AM #2
rsYourTable.MoveFirst
Do While Not (rsYourTable.EOF)
// your code goes here
rsYourTable.MoveNext
Loop
ciener's Avatar
Junior Member with 7 posts.
 
Join Date: Jan 2004
02-Feb-2004, 11:26 AM #3
Or

rs.MoveFirst
Do Until rs.EOF
If BillingDate > Date Then '<----- now() will bring back date and time in the string
result = MsgBox("The billing date is already in the future. Do you still want to update it?", vbOKCancel)
If result = vbOK Then
BillingDate = DateAdd("m", paymentperiod!months, BillingDate)
'else <---- if you want to do something other than result being vbok
End If
End If
rs.MoveNext

VB in an Access 2000 database are you conecting by dns? or straight to it. There is better ways to this. I just dont know how you are coding it. If you need more help on connection and sql.. send a email to me at emalo@charter.net

My guess of what your trying to do.. good luck..

Last edited by ciener : 02-Feb-2004 11:33 AM.
Closed Thread

THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
WELCOME TO TECH SUPPORT GUY! Are you looking for the solution to your computer problem? Join our site today to ask your question -- for free! Our site is run completely by volunteers who help people like you solve computer problems. See our Welcome Guide to get started.



Thread Tools


You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 06:25 AM.
Copyright © 1996 - 2008 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Powered by Cermak Technologies, Inc.