473,396 Members | 2,111 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,396 software developers and data experts.

VBA Access, working with recordset

Hi,
My program contains events, each event has several assignments (displayed on the same form, in a subform).
Each assignment has a checkbox, it's checked to send mail to "assignInCharge" to notify him about the assignment.
Also i have a checkbox "assignIsSent", which is supposed to be checked automatically after sending the first email
(when it's checked, it means the message will be a reminder). Here's the code:

Expand|Select|Wrap|Line Numbers
  1. Set rs = CurrentDb.OpenRecordset("SELECT assignInCharge, workerEmail, assignNum, assignDescription FROM tblAssignments, tblWorkers WHERE assignInCharge = workerNum AND assignSend = -1 AND assignNum = assignNum AND eventNum = " & strEventNum)
  2.  
  3.      Do While Not rs.EOF
  4.            If assignIsSent = False Then
  5.                 If rs(1) & "" <> "" Then
  6.                             'send first notification
  7.                 DoCmd.SendObject acSendNoObject, , , rs(1), , , "Hi, u've got an assignment " & rs(2) & " " & rs(3) & " as part of event " & strEventNum & " " & strEventDescription, strFilePath & "open_app.bat", False
  8.                 End If
  9. ......
  10.  
The mail is sent ok and with the correct parameters, so rs works ok. But the question is,
how do i make this code reference only that specific assignment which i'm sending the mail about?
For instance, event 8 has 3 assignments. I choose the third one and check the checkbox.
But my condition " If assignIsSent = False Then" refers to the first assignment out of three existing, it doesn't know that i'm refering to the third line in the subform... How do i make him know that?
Sorry for the length.. i hope you understood my question.
Would appreciate any help, thanks
Feb 25 '10 #1
0 996

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

Similar topics

3
by: Ryan Ritten | last post by:
Hey, I just started working at this new company and they gave me a simple database project to start with. yet I am starting to look like an idiot cause I can't even seem to connect to the MS...
1
by: lphuong | last post by:
I'm working on a db on Access 2000. I'm also linking that db to some tables on SQL Server Enterprise Manager. My code is stop running at the statement, set db=CurrentDb()? Is that the reason I...
2
by: David C. Barber | last post by:
upsized an MDB to ADP/SQL Server 2000 under Access 2000. All the DAO code that I've changed to ADO code is working fine, HOWEVER the form Record Source itself does not seem willing to return data....
0
by: gm | last post by:
Immediately after generating the Access application from the Source Safe project I get: "-2147467259 Could not use ''; file already in use." If Access database closed and then reopened I get:...
13
by: royaltiger | last post by:
I am trying to copy the inventory database in Building Access Applications by John L Viescas but when i try to run the database i get an error in the orders form when i click on the allocate...
2
by: Frav | last post by:
The Reps team have been experiencing that Access 2002 unexpectedly quits while working and also lots of Corruption Failures and "Record lock can not update" messages since the upgrade from...
6
by: venmore | last post by:
Hi Can someone please point in the right direction. I have an XML file that gets updated every 4 hours on a web server. I can check the XML modification time in ASP and compare to the databse....
6
by: jsacrey | last post by:
Hello everybody, I've got a bit of a situation that I could use some guidance with if possible. I work for an auditing firm where my users audit electronic shipping data for customers to see if...
16
by: Phil Stanton | last post by:
I have a form with a button which is supposed to open an Excel file (With lots of Macros /VBA) in it. The Excel file gets it's data from the Access program Here is the code Private Sub...
2
by: hakkatil | last post by:
Hi to all, I have a page that inserts excel sheet to access database. I am using asp. What I want to do is to check the inserting record if it is in the database. Basicly checking the dublicate...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.