OK Thanks, I looked in the code that I have and cant find it, so here
it is. I really appreciate the help.
Mike
'''CODE STARTS HERE''''
Option Compare Database
Private strCaption1 As String
Private strCaption2 As String
Private Sub Command228_Click()
Call NotifyMe
End Sub
Private Sub district_NotInList(NewData As String, Response As Integer)
MsgBox "Please select a battalion from the list, or select 99 for
other", vbCritical, "Select Battalion"
End Sub
Private Sub Date_DblClick(Cancel As Integer)
Date = ShowMonthCalendar(mc, Nz(Me.Date, 1), , , , True)
End Sub
Private Sub district_AfterUpdate()
Dim COLDATE, ColYear
COLDATE = Me.Date
ColYear = Year(COLDATE)
Dim MyDate, ColWeekDay
ColWeekDay = Weekday(COLDATE)
date1 = ColYear
If ColWeekDay = "1" Then Me.dayOfWeek.Value = "Sunday"
If ColWeekDay = "2" Then Me.dayOfWeek.Value = "Monday"
If ColWeekDay = "3" Then Me.dayOfWeek.Value = "Tuesday"
If ColWeekDay = "4" Then Me.dayOfWeek.Value = "Wedensday"
If ColWeekDay = "5" Then Me.dayOfWeek.Value = "Thursday"
If ColWeekDay = "6" Then Me.dayOfWeek.Value = "Friday"
If ColWeekDay = "7" Then Me.dayOfWeek.Value = "Saturday"
'--------------------------------------------------------------------------
If Me.district = "Battalion 01" Then Me.Battalion = "01"
If Me.district = "Battalion 02" Then Me.Battalion = "02"
If Me.district = "Battalion 03" Then Me.Battalion = "03"
If Me.district = "Battalion 04" Then Me.Battalion = "04"
If Me.district = "Battalion 05" Then Me.Battalion = "05"
If Me.district = "Battalion 99" Then Me.Battalion = "99"
'--------------------------------------------------------------------------
Me.collisonID = [Battalion] & "." & [date1] & "." & [autonumber]
DoCmd.DoMenuItem acFormBar, acRecordsMenu, 5, , acMenuVer70
End Sub
Private Sub Form_Load()
Set mc = New clsMonthCal
dbuser = CurrentUser()
Dim intNewRecord As Integer
intNewRecord = Me.NewRecord
If intNewRecord = True Then
Me.ReportOriginator = dbuser
Me.Command229.Enabled = False
Else
Me.Command229.Enabled = True
End If
Me.Caption = Me.Caption & ", Current User = " & CurrentUser() & ",
Report Originator = " & [Report_Originator] & "."
DoCmd.Close acForm, "frmEntryMenu"
End Sub
'''*****HERES THE PROBLEM CHILD*****'''
Private Sub Cause_Entry_Click()
If Me.NewRecord Then
MsgBox "Yep Its New"
Else
MsgBox "Nah Its Old."
Call CheckCollision
stDocName = "frmCollisionCauses"
stlinkcriteria = "[collisionID]=" & "'" & Me![collisonID] & "'"
DoCmd.OpenForm stDocName, , , stlinkcriteria
If Me.driving_Task = "CT1 Starting-Leaving the station, scene or
parked" Then Forms!frmCollisionCauses!CT1.SetFocus
If Me.driving_Task = "CT2 In Motion-responding, returning, any
vehicle movement" Then Forms!frmCollisionCauses!CT2.SetFocus
If Me.driving_Task = "CT3 Intersection-Approaching, Proceeding
through, Leaving" Then Forms!frmCollisionCauses!CT3.SetFocus
If Me.driving_Task = "CT4 Arriving on Scene or Stopping" Then
Forms!frmCollisionCauses!CT4.SetFocus
If Me.driving_Task = "CT5 Backing" Then
Forms!frmCollisionCauses!CT5.SetFocus
End If
Exit_Cause_Entry_Click:
Exit Sub
Err_Cause_Entry_Click:
MsgBox Err.Description
Resume Exit_Cause_Entry_Click
End Sub
Private Sub Form_Open(Cancel As Integer)
Dim dbuser As Variant
Dim AuthUser As Variant
Dim Lookup As String
Dim Originator As Variant
UserName = "UserName = " & "'" & CurrentUser() & "'"
AuthUser = DLookup("[UserName]", "tblAuditTrailAccess", UserName)
Originator = DLookup("Report_Originator", "tblReport", Lookup)
dbuser = CurrentUser()
If dbuser = AuthUser Then
Me.AuditTrailFolder.Visible = True
ElseIf dbuser = Not AuthUser Then
Me.AuditTrailFolder.Visible = False
End If
End Sub
Private Sub Form_Unload(Cancel As Integer)
If Not mc Is Nothing Then
If mc.IsCalendar Then
Cancel = 1
Exit Sub
End If
'DoEvents
Set mc = Nothing
End If
End Sub
Private Sub Command199_Click()
On Error GoTo Err_Command199_Click
DoCmd.Close
DoCmd.OpenForm "frmEntryMenu"
Exit_Command199_Click:
Exit Sub
Err_Command199_Click:
MsgBox Err.Description
Resume Exit_Command199_Click
End Sub
Private Sub Command229_Click()
On Error GoTo Err_Command229_Click
Dim stDocName As String
Dim stlinkcriteria As String
stDocName = "frmCollisionPicsAll"
stlinkcriteria = "[CollisionID]=" & "'" & Me![collisonID] & "'"
DoCmd.OpenForm stDocName, , , stlinkcriteria
Exit_Command229_Click:
Exit Sub
Err_Command229_Click:
MsgBox Err.Description
Resume Exit_Command229_Click
End Sub
'''CODE ENDS HERE'''
"Allen Browne" <Al*********@SeeSig.Invalid> wrote in message news:<41***********************@per-qv1-newsreader-01.iinet.net.au>...
You must have some code that is moving to an old record, such as a requery?
--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
"Mike" <MU*@verizon.net> wrote in message
news:d5*************************@posting.google.co m... "Allen Browne" <Al*********@SeeSig.Invalid> wrote in message
news:<41***********************@per-qv1-newsreader-01.iinet.net.au>... The form's NewRecord property is a true/false value.
Try:
If Me.NewRecord Then
MsgBox "Yep"
Else
MsgBox "Nah."
End If
"Mike" <MU*@verizon.net> wrote in message
news:d5*************************@posting.google.co m...
>I am having trouble with the new record property. When I attempt to
> place the code under a command button that says the following:
>
>
> ''''CODE STARTS HERE''''
> Private Sub Cause_Entry_Click()
>
> Dim MyForm As Variant
> Dim intnewrec As Integer
>
> MyForm = Me.CurrentRecord
>
> If MyForm = NewRecord Then
>
> MsgBox "You're in a new record."
>
> Else
>
> MsgBox "You're NOTTTTT in a new record."
>
> End If
> ''''CODE ENDS HERE''''
>
> It always defaults to the "else" part of the statement, even when I
> know i am entering a new record.
>
> HELP
> Thanks
> Mike
I tried it and it still fires on the else area... What am I doing
wrong? Do you think it could be an error on where the command button
fires that this is linked to??