G
Guest
I need to limit this recordset to one record selected based on the social
security number from another form. However, when I use the following where,
it gives me an error.
Dim workbase As CurrentProject
Dim cn As ADODB.Connection
Set cn = CurrentProject.AccessConnection
Dim Workrs1 As ADODB.Recordset
Set Workrs1 = New ADODB.Recordset
With Workrs1
Set .ActiveConnection = cn
.Source = "Select * from tblcustomerappquery where firstname =" &
Forms!test1!ssn
.LockType = adLockBatchOptimistic
.CursorType = adOpenKeyset
.Open
End With
Set Forms("test").Recordset = Workrs1
firstnamef = Workrs1("firstname")
Thanks for the help.
security number from another form. However, when I use the following where,
it gives me an error.
Dim workbase As CurrentProject
Dim cn As ADODB.Connection
Set cn = CurrentProject.AccessConnection
Dim Workrs1 As ADODB.Recordset
Set Workrs1 = New ADODB.Recordset
With Workrs1
Set .ActiveConnection = cn
.Source = "Select * from tblcustomerappquery where firstname =" &
Forms!test1!ssn
.LockType = adLockBatchOptimistic
.CursorType = adOpenKeyset
.Open
End With
Set Forms("test").Recordset = Workrs1
firstnamef = Workrs1("firstname")
Thanks for the help.