Show value in one field from another?

G

Guest

I need to STORE a date field in my text box from the value of another text
box which both are date fields.

Example: I have a date box named "Date 1" that has a date manually put in
every now and then. If that text box has a date in it. I want "date box 2" to
show the same date plus 3 weeks. How do I do this in code or? if date box 1
has 7/1/0-7 then date box 2 will have a STORED in a table fiield the date of
7/21/07. Can I use the dateaddd function and a null or? I know it should not
be done this way but my boss says patch it until we move it over to .net.
Please help!
 
G

Guest

Got to use a form.

Use After Update property to call a macro. Have macro to Set Value ---
Item [Forms]![YourFormName]![date box 2]
Expression DateAdd("w",3,[Forms]![YourFormName]![date box 1])

Post back if more explaination is needed.
 
G

Guest

In the After Update event of DateBox1:

If IsDate(Me.DateBox1) Then
Me.DateBox2 = DateAdd("ww", 3, Me.DateBox1)
End If

This will handle Nulls an dates entered incorrectly.
No need to have to create a macro that would only slow it down.
 
G

Guest

This is strange. I opened My SUBFORM and placed it in the after update of my
date box that I want the date to go to. date box 1.
If IsDate(Me.ZoningDue) Then
Me.LoanApplicationPackageReceiptDate = DateAdd("ww", 3, Me.ZoningDue)
End If

It will not work. I also tried it in before update and nothing. I have also
tried the macro and I get null results in the field even if the date is in
date box 2. The date box 2 has populated date in it from another outside
source if that make a difference. Thanks to you for helping. Do either of you
have additional ideas. I am sure we are close or I am missing something?
 
G

Guest

One of us is confused. It seems to me the ZoningDue would be after the
LoanApplicationPackageReceiptDate and that you would enter the
LoanApplicationPackageReceiptDate. If this is correct, it should be in the
After Update event of the LoanApplicationPackageReceiptDate text box.

If IsDate(Me.LoanApplicationPackageReceiptDate) Then
Me.Me.ZoningDue = DateAdd("ww", 3, LoanApplicationPackageReceiptDate)
End If
 
G

Guest

Klatuu,

It could be me but let me try and clearfy. The box that has the actual date
is: LoanApplicationPackageReceiptDate, the box I wan to store the data is
ZoningDue.

Does that make sense?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top