Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

find a value in a record, have a value returned...

Status
Not open for further replies.

mahaMutant

Programmer
Dec 12, 2001
55
GB
i am trying to find a specific string in a table, to be more axact: i want to check whether a productId is in the table, if yes, how can i have that value [productId] returned to the caller;
so far the docmd.find just goes there, it doesn't return a value...
cheers in advance ] always a sucker to the greatest lie of all: will only take a minute [
 
Use the recordset:

private sub txtTextBox_AfterUpdate()
dim rst as recordset

set rst=me.recordsetclone
rst.findfirst "MyField='" & me.txtTextBox & "'"
'Use ' for text type fields and # for date fields
if not rst.nomatch then
msgbox "You allready have MyField value= " & _
me.txtTextBox
endif
end sub

Aivars
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top