Access doesn'it allow it. the code in the compiler turns red..
Do you think I can use the Dlookup code that I sent you with replacing Dlookup with DCount?
User Profile
Collapse
-
I tried it with space like "Company Name" and hits as an error in the compiler.When I use Dlookup I set it like this:
Code:Private Sub Part_Ref_BeforeUpdate(Cancel As Integer) Dim NewCompanyName As String Dim stLinkCriteria As String NewCompanyName = Me.Company_Name.Value stLinkCriteria = "[Company_Name] = " & "'" & NewCompanyName & "'" If Me.Company_Name
Last edited by Rabbit; Mar 12 '14, 06:03 PM. Reason: Please use [code] and [/code] tags when posting code or formatted data.Leave a comment:
-
Hi Seth!
Thanks for your reply!
What I get is: 'Run-time error '2465' Microsoft Access can't find the field 'Company_Name'
In my table the field is 'Company Name'
I think that I don't define the DCount correctly..Leave a comment:
-
Using DCount for duplicate records
Hi guys!
I'm new in the forum and new Access user as well. I have a form where users can insert new data to a table through it. I kow how how to use Dlookup but not familiar with DCount. I want my vba code to prevent the user of using a combination of values that have already been entered. More specific...
My table with name "Company" has three columns that I need to check.
1) column 1 - Company Name
...Last edited by Rabbit; Mar 12 '14, 06:04 PM. Reason: Please use [code] and [/code] tags when posting code or formatted data.
No activity results to display
Show More
Leave a comment: