Wrox Programmer Forums
|
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 30th, 2004, 04:26 PM
Registered User
 
Join Date: Apr 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Coding question

I am trying to write code on a command button that will move through a specified table record by record preforming action based on data found in the table. I am just unsure of what syntax to use. These are the exact operations im trying to do written in psudocode:

1. maximum = Table.ScheduleTime.Count#ofRecords

2. for(index to maximum)
         If(Table.ScheduleTime.index.Time = "9:00AM" Then

***scheduletime is the name of the table
***index is the record we are on
***Time isthe value in the record im testing against

 
Old May 4th, 2004, 02:54 PM
Authorized User
 
Join Date: Apr 2004
Posts: 45
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to lguzman
Default

Should be something like:

    Dim wrkDefault As Workspace
    Dim dbs As Database
    Dim rst As Recordset
    Set wrkDefault = DBEngine.Workspaces(0)
    Set dbs = CurrentDb
    Set rst = dbs.OpenRecordset("scheduletime")
    Do While Not EOF()
       With rst
            if Time = "9:00AM"
               ...
            end if
            .MoveNext
        End With
    WEnd
    ...
    dbs.Close


Hope this helps.



[LGuzman]





Similar Threads
Thread Thread Starter Forum Replies Last Post
Coding Help sugunakar Classic ASP Professional 2 March 30th, 2008 04:42 PM
Coding question (New to XSLT) jcrowley XSLT 2 August 26th, 2007 03:42 PM
Help coding here Scoob PHP How-To 3 January 26th, 2006 11:18 AM
coding mdlan PHP Databases 1 May 28th, 2005 07:40 PM
need guidance in inserting field ( coding question gilgalbiblewheel Classic ASP Databases 3 April 19th, 2005 06:25 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.