Re: Delete record
- From: "Douglas J Steele" <NOSPAM_djsteele@xxxxxxxxxxxxxxxxx>
- Date: Thu, 26 Jan 2006 06:55:33 -0500
What data type is Codigo? If it's numeric, change your code to:
..FindFirst "Codigo=" & Me.lstDic.Column(0)
If it's text, then are you sure that first column actually contains a value?
--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)
"Job via AccessMonster.com" <u17291@uwe> wrote in message
news:5ae6c4df8e6b1@xxxxxx
> Dirk Goldgar wrote:
> >> Hi, I have an old problem.
> >>
> >[quoted text clipped - 33 lines]
> >>
> >> Jorge Barreto
> >
> >I think what you're looking for is
> >
> > .FindFirst "Code='" & Me.lstDic.Column(0, varItem) & "'"
> >
> >Or, if Column(0) is the bound column, you could just use
> >
> > .FindFirst "Code='" & Me.lstDic.ItemData(varItem) & "'"
> >
> Douglas and Dirk, thanks for you help.
>
> Making what it was suggested, the code was thus:
>
> Private Sub cmdExcluir_Click()
> Dim MySet As DAO.Recordset, varItem As Variant
>
> Set MySet = CurrentDb.OpenRecordset("qryDic", dbOpenDynaset)
>
> With Me.lstDic
> For Each varItem In lstDic.ItemsSelected
> With MySet
> ' .FindFirst "Codigo='" & Me.lstDic.Column(0, varItem) &
"'"
> ' .FindFirst "Codigo='" &
Me.lstDic.ItemData(varItem).Column(0)
> & "'"
> ' .FindFirst "Codigo='" & Me.lstDic.ItemData(varItem) & "'"
> .FindFirst "Codigo='" & Me.lstDic.Column(0) & "'"
> If .NoMatch = False Then
> .Delete
> End If
> End With
> Next varItem
> End With
> MySet.Close
> Set MySet = Nothing
> Me.Requery
> End Sub
>
> However, all the alternatives do not function. Emitting the following
error:
> "Incompatible type of data in the criteria expression."
>
> Curiously:
> When I leave for the design mode and I come back toward the form, the data
of
> the register to be deleted are copied on the first register of the table.
>
> It will be that this aid?
>
> Sorry my english, please!!!
>
> --
> Message posted via AccessMonster.com
> http://www.accessmonster.com/Uwe/Forums.aspx/access-forms/200601/1
.
- Follow-Ups:
- Re: Delete record
- From: Job via AccessMonster.com
- Re: Delete record
- References:
- Delete record
- From: Job via AccessMonster.com
- Re: Delete record
- From: Dirk Goldgar
- Re: Delete record
- From: Job via AccessMonster.com
- Delete record
- Prev by Date: Re: Field Format For A Date Using Now()
- Next by Date: Re: filter by form: show possible values for each field
- Previous by thread: Re: Delete record
- Next by thread: Re: Delete record
- Index(es):
Relevant Pages
|