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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Finding a record in a form

Status
Not open for further replies.

ianbrown76

Technical User
Sep 13, 2002
22
GB
Hi

I have a form that is data entry, where Customers details are to be entered.

When a customers Account number is entered a search is made to find out if this information is already held, if we do then I'd like to be able to find the record and be able to amend the data if need be.

This is a complaints database so customers will already have account numbers but the information may not be held in this database. There will only be one record per account number.

I'm able to find out if the information is already held (using Dlookup). I can set the form properties data entry to false and to allow edits. When this happens the very first record in the table is displayed in the form and can be amended.

When using DoCmd.FindRecord Me.Acc I get an 'error 2162' and can't display the record that I'd like to.

Can anybody tell me what I'm doing wrong or offer any better suggestions for a solution?

If you could help me I'd most appreciate it.

Many thanks

Ian
 
Try something like this:

Me.RecordsetClone.FindFirst "yoursearchstring"
If (Not Me.RecordsetClone.NoMatch) Then
Me.Recordset.Bookmark = Me.RecordsetClone.Bookmark
Else
Msgbox "Could not find record"
end if
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top