G
Guest
I am putting together a very simple application and need to identify when the
application is opened in a new month. So I'm using the Month Function to
compare the system date to the last month an entry was made. I built the
tables and form on my work computer and transported the app to my home
computer to do the code. Both computers use XP operating system. The
following code in the Open event of the form gave me a month function return
of "1" on Feb 22, 2007, so I made a text box display the system date and it
displayed 1/1/2007.
Dim intMonth As Integer 'Month function for last recorded date
Dim intDate As Integer 'Month function for today's date
Dim datToday As Date
'Restore
DoCmd.Restore
'Preset fraCycle
Me.fraCycle = 0
'Is this a new month?
datToday = Date
intMonth = Month(datToday)
Me.Text106 = intMonth
Me.Text108 = Date
I checked my system date in the lower right hand corner of my monitor screen
and it was Feb 22, 2007. Then I build a new form with a couple text boxes in
it and the code worked fine.
What code would allow me to transfer this application from XP system to XP
system?
application is opened in a new month. So I'm using the Month Function to
compare the system date to the last month an entry was made. I built the
tables and form on my work computer and transported the app to my home
computer to do the code. Both computers use XP operating system. The
following code in the Open event of the form gave me a month function return
of "1" on Feb 22, 2007, so I made a text box display the system date and it
displayed 1/1/2007.
Dim intMonth As Integer 'Month function for last recorded date
Dim intDate As Integer 'Month function for today's date
Dim datToday As Date
'Restore
DoCmd.Restore
'Preset fraCycle
Me.fraCycle = 0
'Is this a new month?
datToday = Date
intMonth = Month(datToday)
Me.Text106 = intMonth
Me.Text108 = Date
I checked my system date in the lower right hand corner of my monitor screen
and it was Feb 22, 2007. Then I build a new form with a couple text boxes in
it and the code worked fine.
What code would allow me to transfer this application from XP system to XP
system?