Selasa, 07 Januari 2014

Re: [MS_AccessPros] Dcount syntax question

 

I get an Expected end of statement error
 
Jim Wagner



On Tuesday, January 7, 2014 9:45 AM, John Viescas <JohnV@msn.com> wrote:
 
Jim-

Your expression:

cmdEditEmailAddr.Caption = DCount("Edit "& " " & "[EmailAddress]", "tblAccounts", "EmailAddress Is Null") & " " & "Empty email addresses"

Asks for the count of a field named "Edit [EmailAddress]" which probably doesn't exist in your table.  Perhaps you mean to do:

cmdEditEmailAddr.Caption = "Edit " & DCount("[EmailAddress]", "tblAccounts", "EmailAddress Is Null") & " " & "Empty email addresses"


John Viescas, Author
Microsoft Access 2010 Inside Out
Microsoft Access 2007 Inside Out
Microsoft Access 2003 Inside Out
Building Microsoft Access Applications 
SQL Queries for Mere Mortals 
(Paris, France)




On Jan 7, 2014, at 5:14 PM, Jim Wagner <luvmymelody@yahoo.com> wrote:

Hello

I have a dcount expression on the form load event that puts the count of a table on the caption of a button. In the code the second line works great, but I would like to add a word at the beginning of the dcount and everything I have tried has stopped the form from loading. Is it possible to add a word before the dcount? The first line is the one that does not work.




Private Sub Form_Load()
cmdEditEmailAddr.Caption = DCount("Edit "& " " & "[EmailAddress]", "tblAccounts", "EmailAddress Is Null") & " " & "Empty email addresses"
'cmdEditEmailAddr.Caption = DCount("[EmailAddress]", "tblAccounts", "EmailAddress Is Null") & " " & "Empty email addresses"
End Sub

Thank You
 
Jim Wagner



__._,_.___
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (3)
Recent Activity:
.

__,_._,___

Tidak ada komentar:

Posting Komentar