|
howard m
|
kindly assist, i enter the search criteria in a text box linked to a field(name of student) in the table i want to send data to a label linked to another field(age)from d table,such that once i click the get cmd button in my application the data i need corresponding to the search criteria entered in the txt box would appear,
|
|
|
|
|
|
sweet_pawn
|
Put another textbox, label, and button on d form. Bind the label to the field you are searching on,eg. name. Do not bind the text box. Put this in button click event: data1.findfirst "name = "&text1.text Rem You can replace name with the fieldname of d D.B u are searching on.
If data1.nomatch= true then msgbox " No Match Found!" End If
Type your query in the textbox and click on the button.
|
|
|
|
|
|
sweet_pawn
|
Put another textbox, label, and button on d form. Bind the label to the field you are searching on,eg. name. Do not bind the text box. Put this in button click event: data1.findfirst "name = "&text1.text Rem You can replace name with the fieldname of d D.B u are searching on.
If data1.nomatch= true then msgbox " No Match Found!" End If
Type your query in the textbox and click on the button.
|
|
|
|
|
|
jek1471
|
what method are you using to call your database? Are u using the data control or calling the data from code?
You need to code the cmd_click() procedure and provide and SQL such that when you click it, the SQL is invoked and seraches for the record in the database and display in the label.
Example below:
cmd_click() SQL="SELECT * from theDatabase WHERE [label]='"+ucase(trim(txtText.text))+"'" set rs=db.openrecordset(SQL)
if rs.recordcount>0 then lblLabel.caption= rs!label
end sub
This may look complicated, let's discuss further - I'll explain
|
|
|
|
|
|
dotzok
|
"what method are you using to call your database?" - jek1471. Excellent. that was the 1st question that came to ma mind.
u can as well say
rs.Find("SerialNo=' " & UCase(txtSearch.Text) & "'")
theLabel.Caption = rs.Field("Fullname") or txtfullname.Text = rs.Field("Fullname")
rs.Refresh . . .
|
|
|
|
|
|