Re: recordcount gives back -1...
- From: rocco <rocco@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Mon, 7 Aug 2006 14:19:03 -0700
I have already done this..and it doesn't work!!
That's really strange. Isn't it?
Thanks anyway
"Douglas J. Steele" wrote:
rst.Open "SELECT * FROM " & tbll.Name & " WHERE CODRATER=" &.
Forms(ff.Name).Controls("CERCA").Value, CurrentProject.Connection,
adOpenDynamic, adLockOptmistic
rst.MoveLast
rst.MoveFirst
If rst.RecordCount > 0 Then
--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)
"rocco" <rocco@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:02BF10AF-FDB1-499D-9CB3-B1E227CCC560@xxxxxxxxxxxxxxxx
Hello,
I have code (posted below) which needs to evaluate the numbers of records
entered for each rater of a questionnaire. I can have a maximum of 50
raters.
each rater has a code going from 1 to 50.
But when I evaluate the recordcount property in the code below i always
get
a -1 and the code that should be run is skipped...
Here is the code:
Public Sub Salva(tbll As TableDef, ff As Form)
Dim i As Integer
Dim rst As ADODB.Recordset
Set rst = New ADODB.Recordset
If GeneralCheck(ff) = True Then
If finderlet = True Then
MsgBox tbll.Name
MsgBox tbll.RecordCount
rst.Open "SELECT * FROM " & tbll.Name & " WHERE CODRATER=" &
Forms(ff.Name).Controls("CERCA").Value, CurrentProject.Connection,
adOpenDynamic, adLockOptmistic
If rst.RecordCount > 0 Then
For i = 0 To rst.Fields.Count - 2
rst.Fields(i).Value =
IIf(IsNull(Forms(ff.Name).Section(acDetail).Controls(rst.Fields(i).Name).Value),
Null, Forms(ff.Name).Section(acDetail).Controls(rst.Fields(i).Name).Value)
Next i
rst.Update
End If
MsgBox "Dati aggiornati!", vbInformation, "Registrazione
effettuata"
(follow other code...)
Any hint?
Thanks,
Rocco
- References:
- Re: recordcount gives back -1...
- From: Douglas J. Steele
- Re: recordcount gives back -1...
- Prev by Date: Re: recordcount gives back -1...
- Next by Date: RE: ODBCDirect Workspace
- Previous by thread: Re: recordcount gives back -1...
- Next by thread: Re: return system information using VBA
- Index(es):
Relevant Pages
|