Dear All,

Mohon bantuan.

Saya mempunyai tombol New dengan command dibawah ini. Aplikasi ini digunakan
secara sharing. Tombol ini berjalan normal, namun kadang-kadang tidak bisa
berfungsi, dengan pesan error krn adanya duplikasi.


Adakah kesalahan dari coding ini atau ada masalah lain?

Private Sub newpr_Click()
DoCmd.GoToRecord , "FRM_Pr", acNewRec

Dim LastSending As String
LastSending = DLast("NoPR", "tbl_pr")
Me![NoPR] = Format(Left(LastSending, 4) + 1, "0000") & Right(LastSending,
Len(LastSending) - 4)

name1 = [Forms]![login]![Cmbuserid]
cmbsection = [Forms]![login]![Txtsection]

nomerPR.Visible = True
date.Locked = False
name1.Locked = True
cmbsection.Locked = True
paidto.Locked = False
CMBCURRENCY.Locked = False
amount.Locked = False
explanation.Locked = False
'Acknowledged1.Locked = False
'Approved.Locked = False
save.Enabled = True

'save.Caption = "Save"

If cmbsection.Value = "sales adm" Then
lblSIM.Visible = True
im1.Visible = True
m1.Visible = True
im2.Visible = True
m2.Visible = True
im3.Visible = True
m3.Visible = True
im4.Visible = True
m4.Visible = True
End If
If cmbsection.Value = "sales" Then
lblSIM.Visible = True
im1.Visible = True
m1.Visible = True
im2.Visible = True
m2.Visible = True
im3.Visible = True
m3.Visible = True
im4.Visible = True
m4.Visible = True
End If
Me.paidto.SetFocus

DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
DoCmd.RunCommand acCmdRefreshPage
End Sub


Terima kasih
suka.access

Kirim email ke