Duplicate records , no error message

Here it is :
I had added this line : DoCmd.GoToRecord , , acNewRec
but it kinda creates problems with my application which i haven't figured out yet


Option Compare Database

Private Sub Form_Activate()
DoCmd.Maximize
End Sub

Private Sub Form_GotFocus()
DoCmd.Maximize
End Sub

Private Sub Form_Open(Cancel As Integer)
DoCmd.Maximize
Me.ViewAll.Visible = False
Me.ViewMy.Visible = False
End Sub

Private Sub SignedInUser_Change()
Me.ViewAll.Visible = True
Me.ViewMy.Visible = True

GlobalSignedInUser = Me.SignedInUser.Value
Rem SCR #24
'GlobalLoginInd = 0
'GlobalNetworkID = fNetworkID()
'GlobalComputerName = fMachineName()
End Sub

Private Sub ViewAll_Click()
On Error GoTo Err_ViewAll_Click

Dim stDocName As String
Rem SCR #24
GlobalLoginInd = 1
'DoCmd.GoToRecord , , acNewRec
DoCmd.RunCommand acCmdSaveRecord

stDocName = "IPR - View current list - View all "
DoCmd.RunMacro stDocName

Exit_ViewAll_Click:
Exit Sub

Err_ViewAll_Click:
MsgBox Err.Description
Resume Exit_ViewAll_Click

End Sub
Private Sub ViewMy_Click()
On Error GoTo Err_ViewMy_Click

Dim stDocName As String
Rem SCR #24
GlobalLoginInd = 1
'DoCmd.GoToRecord , , acNewRec
DoCmd.RunCommand acCmdSaveRecord
MsgBox GlobalSignedInUser

stDocName = "IPR - View current list - View My"
DoCmd.RunMacro stDocName

Exit_ViewMy_Click:
Exit Sub

Err_ViewMy_Click:
MsgBox Err.Description
Resume Exit_ViewMy_Click

End Sub
 
What does your Macro "IPR - View current list - View all" do?

I can not see any actions here that would cause records to be removed from your User_Log.

(I can't see the error trapping either though. Is this the same form?)

Brad.
 
Hi Brad !!!

The code worked !!!
DoCmd.GoToRecord , , acNewRec

Now my USER_LOG table is being updated correctly , I can start with error trapping ! Whew!

The "View All" macro just opens a form based on a filtered query.
Yes nothing gets deleted , i think accmdsaverecord just writes to the current record , though i cldn't be sure :rolleyes:


Now i will put in my error trapping code ,
I hope u'll be around, coz i'm dfinitely gonna stumble again ,

u've been a great help!
Thanx,
Gina.
 
Gina,

Have you been able to figure out why an "INSERT" clause will not bring up any error message when trying to insert a duplicate value?

Right now I can't know if there was any duplicates that have not been added with the "INSERT" clause. I read your whole post but it is not clear to me how you solved this problem.

Thanks
 
Hi Mario ,

No I don't.
I cldn't figure it why the INSERT didn't work .

Gina.
 
Last edited:
One of the unsolved mysteries. Thanks anyway, I appreciated your quick reply.
 

Users who are viewing this thread

Back
Top Bottom