LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 34
Default Looping through code for every record in a table

Hi,

I have a table with 2 fields - flddate and category. There are 999
records in the table. Currently I use the below code to create an
outlook appointment from one of the records in the table. However I
would like to loop through each of the records to create an outlook
appointment for each of the records. I guess I need to create an ID
for each record and loop through the reocrd numbers but I don't know
where to start.

Private Sub Command6_Click()
DoCmd.Save
Dim objFolder As MAPIFolder
Dim spobj As Variant
Set spobj = CreateObject("Outlook.Application")
Dim outobj As Outlook.Application
Dim objAppt As Outlook.AppointmentItem
Dim Msg, Style, Title, Help, Ctxt, Response, MyString
Set outobj = CreateObject("outlook.application")
Set objAppt = outobj.CreateItem(olAppointmentItem)
With objAppt
objAppt.Start = [fldDate]
objAppt.AllDayEvent = True
.Subject = category
.ReminderSet = False
.Save
DoCmd.RunCommand acCmdSaveRecord
End With
End Sub

Thanks,

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Code looping through files Otto Moehrbach Excel Programming 66 January 5th 07 07:46 PM
Help with Looping Code JimMay Excel Programming 5 June 6th 06 03:43 AM
stopping code from looping tjb Excel Worksheet Functions 3 December 7th 05 02:02 AM
Looping macros using VB code accessuser1308 Excel Discussion (Misc queries) 2 March 9th 05 11:11 PM
Code looping when it should not Todd Huttenstine Excel Programming 3 May 13th 04 09:37 PM


All times are GMT +1. The time now is 12:32 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"