vb sift through records in a query

s0rtd

Registered User.
Local time
Tomorrow, 06:35
Joined
Apr 16, 2003
Messages
96
hey guys,

if i have a select query and a form with some vb code, how do i sift through the records produce by running the query?? (in vb)


i want to use the code to take certain actions depending on the data that the query displays.


cheer
Jurgen
 
Jurgen,

Are you meaning VB code traversing a recordset?

Things rst.MoveNext and so on?

Wayne
 
yeah, i think so...


what i have is a number of people all scheduled to do jobs on specific days, at specific times throughout the day and there is also an expected end date and time for each date.

the query rips out this data from a table, each person has their own query for their jobs.

what i want to do is create a form which has each day split into segments (time). I am writing some code that goes through each query record by record and depending on what it finds, changes the the colour of the time boxes on the form (to show if the person is busy or not).

i hope this makes it easier to understand... quite a kool project really :) (i should learn heaps :) )


cheer
Jurgen
 
Last edited:
.
I am writing some code that goes through each query record by record and depending on what it finds, changes the the colour of the time boxes on the form (to show if the person is busy or not).

If I understand correctly what you are trying to do, you should NOT be using code to loop through a recordset. You should place the code in the on Current event of your form so that each time the current record changes, the code is executed. If you have a coninuous form, you will need to use conditional formatting. While reading each record of a recordset in a code loop, where were you planning on holding the properties of each field for each record? And then, how were you planning on matching those stored settings with the records currently being displayed?
 
:) its not that complex...yet :P

at the moment all i want is a series of boxes; 8 boxes per day (1 for every hour)
what i want to do is; use the vb code to traverse through the records produced by my query and change the colour of the boxes on the form (each person will have their own subform (single form embedded within a main form) )

so for instance: a job is schedule for 05/09/2003 at 10 am and the job is expected to finish on the same day at 12pm. The 10am box will be coloured red up to the 12pm box.

this is all i want to do for now, but things will undoubtedly get more complicated when i think of new features to add :P


is this possible so far?? (also using vb how do you look at a record within a query??)

thanx for your patience :)

Jurgen
 
The user would loop through the recordset by pressing the next button. You don't need to do this in the background, Access generates the code necessary to do it for bound forms. Your request isn't making any sense to me. Maybe I need to hit the hay.

Look up MoveNext, etc. in help for code samples.
 

Users who are viewing this thread

Back
Top Bottom