Jump to content

pesquiza em listbox


ballkiller
 Share

Recommended Posts

Boas tardes,

tou a fazer um programa e quando vou fazer a pesquiza, se por exemplo, pesquizo o numero 1 e se antes do numero 1 tiver o 1234, ele apresenta o 1234 e nao o 1

Dim dbs As Database

Dim rsprod As Recordset

Set dbs = OpenDatabase("C:\Users\Ricardo\Desktop\Bombeiros_Merceana\utentes")

Set rsprod = dbs.OpenRecordset("utente")

rsprod.Index = "PrimaryKey"

rsprod.Seek "=", wnr_utente

If wnr_utente <> "" Then

    If Not rsprod.NoMatch Then

       

       wcod = rsprod!cod_utente

        wnome = rsprod!nome

        wmorada = rsprod!morada

        wlocalidade = rsprod!localidade

        wnr_utente = rsprod!nr_utente

        wtelefone = rsprod!telefone

        wcod_postal1 = rsprod!cod_postal1

        wcod_postal2 = rsprod!cod_postal2

        wcod_postal3 = rsprod!cod_postal3

        wobservacoes = rsprod!observações

        Else

        MsgBox ("Código não existente"), vbInformation

         wcod = ""

                        wnome = ""

                        wobservacoes = ""

                        wcod_postal3 = ""

                        wcod_postal2 = ""

                        wcod_postal1 = ""

                        wtelefone = ""

                        wnr_utente = ""

                        wlocalidade = ""

                        wmorada = ""

     End If

Else

MsgBox ("Introduza o Código.")

End If

Desde ja um abraço e espero que me possam ajudar rapidamente 🙂 :)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.