Anthony_Harvey1
06-19-2006, 06:11 AM
Hi guys,
I am a relative newbie when it comes to using VBA in Microsoft Access.
I have the following issue and am really stuck :
When I insert a new record, the following code doesn't work :
If DCount("[Client URN]", "Advocacy", "[Client URN]=" & Me!URN) = 1 Then
Me.Memb_AdvocacyProj = True
Me.Memb_AdvocacyProj.Enabled = False
Else
Me.Memb_AdvocacyProj = False
Me.Memb_AdvocacyProj.Enabled = True
End If
I know the reason is that because it is a new record, it is yet to be assigned a URN (the primary key). However, I cannot get round this. Any suggestions would be greatly appreciated.
Thanks
Tony:)
I am a relative newbie when it comes to using VBA in Microsoft Access.
I have the following issue and am really stuck :
When I insert a new record, the following code doesn't work :
If DCount("[Client URN]", "Advocacy", "[Client URN]=" & Me!URN) = 1 Then
Me.Memb_AdvocacyProj = True
Me.Memb_AdvocacyProj.Enabled = False
Else
Me.Memb_AdvocacyProj = False
Me.Memb_AdvocacyProj.Enabled = True
End If
I know the reason is that because it is a new record, it is yet to be assigned a URN (the primary key). However, I cannot get round this. Any suggestions would be greatly appreciated.
Thanks
Tony:)