473,387 Members | 1,485 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,387 software developers and data experts.

ADODB.Connection & Recordset

I have a form that shows policy information for an insurance brokerage. When I enter the effective and expiration date of a policy, it calculates and updates a field called DaysInsured.

If a policy cancels, I enter a cancellation date. This updates another field called DaysInsuredBeforeCancellation.

On the After Update part of the cell called CancellationDate, I want the database to look at another table, called ProRata, in the same database. The other table has two colums, the first is Days and the second is ProRataAmount.

I want the database to take the value in the DaysInsuredBeforeCancellation cell, look in the 2nd table (ProRata), find the record under Days equals the value in DaysInsuredBeforeCancellation and then take the amount in the ProRataAmount field and enter it into the original form/table in a cell called ProRataFactor.

I know I need Connection and Recordset to do this but cannot get it done right. Any ideas on how to write the code?

Windows XP
Access 2003
Mar 10 '08 #1
1 1867
Zwoker
66
I have a form that shows policy information for an insurance brokerage. When I enter the effective and expiration date of a policy, it calculates and updates a field called DaysInsured.

If a policy cancels, I enter a cancellation date. This updates another field called DaysInsuredBeforeCancellation.

On the After Update part of the cell called CancellationDate, I want the database to look at another table, called ProRata, in the same database. The other table has two colums, the first is Days and the second is ProRataAmount.

I want the database to take the value in the DaysInsuredBeforeCancellation cell, look in the 2nd table (ProRata), find the record under Days equals the value in DaysInsuredBeforeCancellation and then take the amount in the ProRataAmount field and enter it into the original form/table in a cell called ProRataFactor.

I know I need Connection and Recordset to do this but cannot get it done right. Any ideas on how to write the code?

Windows XP
Access 2003
Hi,

Are the tables you are talking about contained in the same database that you have the form etc... in? If so, you don't need a connection string, you can just open the tables and read the data into a recordsets. From there you can find the records you want and process them.

If this is the case let me know and I'll give you some example code to open and read the data. If they are in a different database, is it an MS Access database? Or something different?

Also, in your question you talk about a "cell". I'm not sure what you mean by that. Are you referring to a field in the table? Or a text box on the form?


Regards,
Zwoker.
Mar 11 '08 #2

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

Similar topics

0
by: Channing Jones | last post by:
Hello everyone, I am trying to store data in a binary field of an SQL-Server table using ADODB. So far, I have managed to store a record but not any data in the binary field. I only get...
5
by: Simone | last post by:
Hello I hope you guys can help me. I am very new to ADO... I am creating a ADODB connection in a module and trying to access it from a command button in a form. Function fxEIDAssgn(plngEID As...
0
by: Andre Azevedo | last post by:
Hi all ! I've created a .net serviced component with only one method. This method receive an ADODB.Command object and execute it. The ADODB.Command object is created in the client process. (VB...
3
by: Yuk Tang | last post by:
I'm trying to grab the fieldnames and values from a recordset, but I'm getting errors. I have an idea what the error might come from, but I'm not sure how to correct it. I'm connecting to an...
7
by: boyleyc | last post by:
Hi all I have written a database in access and used ADODB recordsets all the way through. The only recordsets that are not ADODB are the listbox navigation code automatically generated by access...
3
by: mark_aok | last post by:
Hi all, All I am trying to do is open a table, edit it, and then close it. But I am having the strangest error. Here is my code Dim i as integer Dim rs as adodb.recordset Set rs = new...
7
by: STUPIDFORUM | last post by:
ADODB.Recordset "The connection cannot be used to perform this operation." "Microsoft Access Driver" ERROR 0X800A0E7D OLE exception from "ADODB.Recordset": The connection cannot be used to...
2
bmallett
by: bmallett | last post by:
I am getting the following error: Error Type: ADODB.Command (0x800A0BB9) Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another....
16
by: cephal0n | last post by:
Hello! I have been reading articles all day and still do not get an explanation WHY is this happening. I'm using ADO in msaccess and set up a connection with ADODB, which I have successfully...
2
EYE4U
by: EYE4U | last post by:
Hi all, This is how you can connect to an Access Database using ADODB.. First add a reference to Microsoft ActiveX Data Objects 2.0 Library Now to lets Declare some variables : Private Con...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...

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.