PDA

View Full Version : Solved: Simple question; (DoCmd.FindRecord)



NFFC_Evans
04-19-2007, 03:53 PM
Hello all, to get straight to the point, I have a database with a 'Customer Details' Table. Baring in mind that the field Customer ID is (the primary key) issued for each customer, I need to know some VBA code that will allow me to enter a customer ID and find the related records for that customer.

I have tried using a form with a text1.txt but my visual basic skills aren't great. I'd love it if anyone could help!

Basically what I've got in mind is either a form/prompt that will allow me to enter a customer ID, and then this customers details are found. I need it in VBA.

cheers for anything you can suggest :)

omocaig
04-19-2007, 07:58 PM
Have a look at this article from the MS Knowledge Base...

304428 (http://support.microsoft.com/kb/304428/) (http://support.microsoft.com/kb/304428/) How to use the query by form (QBF) technique

hth,
Giacomo

OBP
04-20-2007, 04:04 AM
A very simple alternative is to use a Combo Box.
Another alternative if you are using a "Search Form" is to just set a query's Criteria Row to the Search Form's CustomerID.
You don't need any VBA for the first method and very little (run the query) for the second.

NFFC_Evans
04-21-2007, 02:05 PM
Thank you for the responses, the reason I wanted to have a more complex/more code based idea is because this is for coursework and the more technical the better, but thank you again for the replies.

NFFC_Evans
04-21-2007, 03:34 PM
The QBF solution worked a dream btw :D