Dynamic TextBox on a Form Problem

rob_andy

New Member
Joined
Mar 12, 2003
Messages
33
I want the field in a form I'm building to look at a date and number of months, calculate an end date and then compare the end date to the current date. I've managed to build some working code but here's where the problem starts. The form is a continuous form that display loads of records that are associated with a customer, this dynamic field is reproduced for each record. I don't know how to either load the code for each record or loop through every record.

Dim insDate As Date
Dim warr As Double
Dim endDate As Date

If Not installDate.Value = "" Then
insDate = installDate.Value
warr = warranty.Value
endDate = DateAdd(m, warr, insDate)
If endDate > Date Then
Text22.Value = "Yes"
Else
Text22.Value = "No"
End If
End If

I just don't know where to put it or how to loop through a continous form. Thanks for any help. R
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
Independence in Access continuous forms with unbound controls is almost non-existant (ALMOST :) ). The better way to accomplish the independence that you're looking for is to write a query which captures all of your needed fields and then add a field in that query which will perform the calculation that you need. Then, use this query as your continuous forms' Record Source and bind your previously unbound control to the calculated field in your query.
 
Upvote 0

Forum statistics

Threads
1,221,547
Messages
6,160,456
Members
451,647
Latest member
Tdeulkar

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top