Jump to content
Felipe75

TextBox

Recommended Posts

Felipe75

Dim procuratext, procuramatricula, instrucao As String
	procuratext = txt_nome.Text
	procuramatricula = txt_matricula.Text
	If radioNome.Checked = True Then
		If txt_nome.Text <> Nothing Then
			instrucao = "SELECT * FROM Registo WHERE Nome LIKE '" & procuratext & "'"
			Me.RegistoTableAdapter.Adapter.SelectCommand.CommandText = instrucao
			Me.RegistoTableAdapter.Fill(Me._OFICINA_MDFDataSet.Registo)
		Else
			MsgBox("Por favor preencha o campo de pesquisa.", MsgBoxStyle.Exclamation, "Graze-Oficina de Motos - Nuno Grazina")
		End If
	Else
		txt_matricula.Enabled = False
	End If

	If radioMatricula.Checked = True Then
		If txt_matricula.Text <> Nothing Then
			instrucao = "SELECT * FROM Registo WHERE Matrícula LIKE '" & procuramatricula & "'"
			Me.RegistoTableAdapter.Adapter.SelectCommand.CommandText = instrucao
			Me.RegistoTableAdapter.Fill(Me._OFICINA_MDFDataSet.Registo)
		Else
			MsgBox("Por favor preencha o campo de pesquisa.", MsgBoxStyle.Exclamation, "Graze-Oficina de Motos - Nuno Grazina")
		End If
	Else
		txt_nome.Enabled = False
	End If

Alguem me diz o erro do txt_matricula porque o txt_nome funciona

Share this post


Link to post
Share on other sites
Cerzedelo

Tem de indicar quais são os erros, caso contrário duvido que alguém lhe responda, porque por estes lados ainda ninguém tem poderes premonitórios.

Share this post


Link to post
Share on other sites
vikcch

instrucao = "SELECT * FROM Registo WHERE Matrícula LIKE '" & procuramatricula & "'"

pode ser pelo acento no i em Matrícula

Share this post


Link to post
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

×
×
  • 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.