Visual Basic Help needed

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a database with a one date field and a second date field that I want
to calculate from the first field for 30 months.

So, I have [Main Roster].[Initial_106_2_Qual] first field, and [Main
Roster].[Current_106_2_RequalDate] second field. I want the date first date
field to calculate out 30 months and post it inthe second date field.

I have this subroutine thus far.


Private Sub Active_Initial_106_2_Qual_Enter()
DoCmd (DateAdd("m", 30)([Main Roster Database].[Form_Main
Roster]![Current_106_))
End Sub

Please help. Thank you in advance
 
DoCmd shouldn't be there, for one thing. In general it would be something
like this:
Me.SecondDateField = DateAdd("m",30,[FirstDateField])
I expect this would go into the after update event for FirstDateField, but
there are other options.
 
My apologies, I had a problem with my computer and had to shut it down, and
was not sure if it posted.

BruceM said:
DoCmd shouldn't be there, for one thing. In general it would be something
like this:
Me.SecondDateField = DateAdd("m",30,[FirstDateField])
I expect this would go into the after update event for FirstDateField, but
there are other options.

JudyT said:
I have a database with a one date field and a second date field that I want
to calculate from the first field for 30 months.

So, I have [Main Roster].[Initial_106_2_Qual] first field, and [Main
Roster].[Current_106_2_RequalDate] second field. I want the date first
date
field to calculate out 30 months and post it inthe second date field.

I have this subroutine thus far.


Private Sub Active_Initial_106_2_Qual_Enter()
DoCmd (DateAdd("m", 30)([Main Roster Database].[Form_Main
Roster]![Current_106_))
End Sub

Please help. Thank you in advance
 
Hi Bruce,

At the end of your reply you state there are other options, can you tell me
what they are?

BruceM said:
DoCmd shouldn't be there, for one thing. In general it would be something
like this:
Me.SecondDateField = DateAdd("m",30,[FirstDateField])
I expect this would go into the after update event for FirstDateField, but
there are other options.

JudyT said:
I have a database with a one date field and a second date field that I want
to calculate from the first field for 30 months.

So, I have [Main Roster].[Initial_106_2_Qual] first field, and [Main
Roster].[Current_106_2_RequalDate] second field. I want the date first
date
field to calculate out 30 months and post it inthe second date field.

I have this subroutine thus far.


Private Sub Active_Initial_106_2_Qual_Enter()
DoCmd (DateAdd("m", 30)([Main Roster Database].[Form_Main
Roster]![Current_106_))
End Sub

Please help. Thank you in advance
 

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

Similar Threads

Visual basic help 13
Dlookup 7
Verfication of user entered data 8
Calculating Due Date 5
Date calculation 22
need help with this 20
3 Conditional formats 2
IF/AND/OR/DATEIF Issue...sorry...long post... 1

Back
Top