J
Jared
I don't want to allow a user to enter a duplicate entry of a database field
in the form. Therefore I'm attempt to use a before update event to query the
database for the user's entry and return a message if it is a duplicate. I'm
new to access, but comfortable with ADO, so I'm trying to use ADO to return a
recodset object. My code looks something like:
strSQL = "Select Complaint_Nbr FROM Complaints where Complaint_nbr = '" &
Form_Data_Entry.[Primary_Complaint_Number] & "'"
boolDupId = False
Set RsC = New ADODB.Recordset
Set cn = New ADODB.Connection
DB_Name = CurrentProject.Path & "\" & CurrentProject.Name
cn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" &
DB_Name
cn.Open
RsC.Open strSQL, cn, adOpenForwardOnly, adLockReadOnly
I get an error message that the database has been placed in a state by the
user of machine that prevent the database from being opened.
Anybody know of another way to do this?
Thanks
in the form. Therefore I'm attempt to use a before update event to query the
database for the user's entry and return a message if it is a duplicate. I'm
new to access, but comfortable with ADO, so I'm trying to use ADO to return a
recodset object. My code looks something like:
strSQL = "Select Complaint_Nbr FROM Complaints where Complaint_nbr = '" &
Form_Data_Entry.[Primary_Complaint_Number] & "'"
boolDupId = False
Set RsC = New ADODB.Recordset
Set cn = New ADODB.Connection
DB_Name = CurrentProject.Path & "\" & CurrentProject.Name
cn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" &
DB_Name
cn.Open
RsC.Open strSQL, cn, adOpenForwardOnly, adLockReadOnly
I get an error message that the database has been placed in a state by the
user of machine that prevent the database from being opened.
Anybody know of another way to do this?
Thanks