Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Checking if Record has already been entered?

Author  Topic 

millos21
Starting Member

13 Posts

Posted - 2001-02-01 : 16:11:08
Can someone tell me what is wrong with this code?
What I'm trying to do is to check if the social security number has been entered, before the user goes to the next field. This used to work fine in Access 2000, But I'm having problems now that I'm using SQL 7.0 as a backend and Access Project as a front end.

here is the code:

Private Sub SS_BeforeUpdate(Cancel As Integer)
If dcount("[SS#]", "TableName", "[SS#]='" & Forms!FormName![SS#]) & "'" Then
msgbox ("This number has already been entered")
docmd.cancelevent
end if
end sub

SS# is being stored as a string variable

thanks for any help,

Cesar


   

- Advertisement -