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

Re: Access Question for Zimbler

By: Decomposed in 6TH POPE | Recommend this post (0)
Mon, 23 May 22 2:16 AM | 28 view(s)
Boardmark this board | 6th Edition Pope Board
Msg. 32176 of 60008
(This msg. is a reply to 32175 by Decomposed)

Jump:
Jump to board:
Jump to msg. #







If I use the prior procedure and function as written, I get the error message to the left when I open the form.















Avatar

Gold is $1,581/oz today. When it hits $2,000, it will be up 26.5%. Let's see how long that takes. - De 3/11/2013 - ANSWER: 7 Years, 5 Months


- - - - -
View Replies (1) »



» You can also:
- - - - -
The above is a reply to the following message:
Access Question for Zimbler
By: Decomposed
in 6TH POPE
Mon, 23 May 22 1:56 AM
Msg. 32175 of 60008

Zimbler0:

Re: “How to check for a duplicate?”
I'd like my database to tell me each time I enter a new book title or modify an existing one how many books with that name are already in the table. If the answer is 'none,' I wouldn't want it to say anything. I don't want it preventing entry of a duplicate... just informing me with MsgBox.

  • The form is frmMedia.
  • The table is tblMedia.
  • The form has a field named Title.
  • The table has a field named Title.

Do you know how? I've been trying with DCount, like this:


Private Sub Title_lostFocus()
Dim x As Integer
  x = DupTitleCount()
  MsgBox (x)
End Sub

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






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