« 6TH POPE Home | Email msg. | Reply to msg. | Post new | Board info. Previous | Home | Next

Re: Access Question for Zimbler - got it! 

By: Zimbler0 in 6TH POPE | Recommend this post (1)
Mon, 23 May 22 5:44 PM | 17 view(s)
Boardmark this board | 6th Edition Pope Board
Msg. 32194 of 60008
(This msg. is a reply to 32183 by Decomposed)

Jump:
Jump to board:
Jump to msg. #

Decomposed > Thanks for the suggestions, Zim!


Good to know you got it De.
Yeah, getting that syntax all just right was always a pain in the rump . . .

Zim.




Avatar

Mad Poet Strikes Again.




» You can also:
- - - - -
The above is a reply to the following message:
Re: Access Question for Zimbler - got it!
By: Decomposed
in 6TH POPE
Mon, 23 May 22 4:19 AM
Msg. 32183 of 60008

I spent about 5 hours getting this small amount of code to work. But it finally does. Here's the syntax used in the form's Title field AfterUpdate event.:

Private Sub Title_AfterUpdate()
Dim x As Integer
  x = DupTitleCount()
  If x <> 0 Then MsgBox ("Prior copies in the database: " & x)
End Sub

Public Function DupTitleCount() As Integer
  DupTitleCount = DCount("[Title]", "tblMedia", "[tblMedia].[Title] = '" & Forms![frmMedia]![Title] & "'")
End Function

Thanks for the suggestions, Zim!


« 6TH POPE Home | Email msg. | Reply to msg. | Post new | Board info. Previous | Home | Next