Balshe
asked on
DataEnvironment and check If record Exist??
I try to check if a record exists before adding new Record
and after the find Line i get this error:
" Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another."
the command Properties:
CommandType=AdcmdTable
CurserLoaction=aduseserver
CursorType=adopenKeyset
LockType=adlLockOptimistic
What is wrong?????
With DataEnvironment1.rsCmdSche ma
If Not .BOF Then .MoveFirst
.Find "[Schema] ='" & Trim(txtSchema) & "'" & " and [Stage_id]=" & CmbStage.ItemData(CmbStage .ListIndex ), , adSearchForward
If Not .EOF Then
MsgBox "Record Already Exists" & vbCrLf & vbCrLf & "Pls Write New Schema Name Or Stage"
PutFocus txtSchema
Exit Sub
End If
.AddNew
!Schema = Trim(txtSchema)
!stage_id = Val(CmbStage.ItemData(CmbS tage.ListI ndex))
.Update
RsChanged = True
End With
and after the find Line i get this error:
" Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another."
the command Properties:
CommandType=AdcmdTable
CurserLoaction=aduseserver
CursorType=adopenKeyset
LockType=adlLockOptimistic
What is wrong?????
With DataEnvironment1.rsCmdSche
If Not .BOF Then .MoveFirst
.Find "[Schema] ='" & Trim(txtSchema) & "'" & " and [Stage_id]=" & CmbStage.ItemData(CmbStage
If Not .EOF Then
MsgBox "Record Already Exists" & vbCrLf & vbCrLf & "Pls Write New Schema Name Or Stage"
PutFocus txtSchema
Exit Sub
End If
.AddNew
!Schema = Trim(txtSchema)
!stage_id = Val(CmbStage.ItemData(CmbS
.Update
RsChanged = True
End With
The Find method accepts only one criteria.
Have a look at Filter (it accepts more then one criteria).
ASKER
can u tell me how would it look like?
i would be greatful
thank u
i would be greatful
thank u
ASKER
i mean if u could write a code helping me to understand how??????
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.