[AccessD] dbl click on a list box

Kostas Konstantinidis kost36 at otenet.gr
Tue Jun 29 12:31:38 CDT 2004


Hi Gustav,
Your advice is always precious.
Doris, thank's u2

Be well both of you
_kostas

----- Original Message ----- 
From: "Gustav Brock" <gustav at cactus.dk>
To: "Access Developers discussion and problem solving"
<accessd at databaseadvisors.com>
Sent: Tuesday, June 29, 2004 6:01 PM
Subject: Re: [AccessD] dbl click on a list box


> Hi Kostas
>
> > I am trying to open a form based on a list box criteria with a double
click.
> > the list box is linked to a table: SELECT MT_basic_char.AM FROM
> > MT_basic_char;
>
> > What I want to do is on doulble click to open the main form
MT_basic_char
> > based on the line's AM I double click
>
> > I use the follown but it always just open the first record and not the
> > filter one I have chosen via double click
>
> > Private Sub list2_DblClick(Cancel As Integer)
> >     Dim stDocName As String
> >     Dim stLinkCriteria As String
> >
> >     stDocName = "MT_basic_char"
> >     DoCmd.OpenForm stDocName, , , stLinkCriteria
> >     stLinkCriteria = Me!list2 = Forms!mt_basic_char!AM
> >
> > End Sub
>
> I think you have mixed it up a bit ... you must define your criteria,
> then open the form:
>
>     stDocName = "MT_basic_char"
>
>     stLinkCriteria = "[AM] = " & Me!list2.Value & ""
>     - or if AM is a String:
>     stLinkCriteria = "[AM] = '" & Me!list2.Value & "'"
>
>     DoCmd.OpenForm stDocName, , , stLinkCriteria
>
> /gustav
>
> -- 
> _______________________________________________
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
>
>





More information about the AccessD mailing list