Viewing Certain Records using a form.

A

andy

I have created a form to view records in a database.
When I open this form I shows me the first record and I
then have to use the command buttons at the bottom to move
through the records.
As I input each record I give it a unique reference no(ID
NO), the number is usually in sequence but some times I
use an additional character to highlight some records.ie
(301-03,302-03, 302-AK, 302-BK)

When I open the form is it possible to have it blank and
then input MY reference no and have the form show the data
for that ID?

Thanks for any help
andy
 
A

Al Campagna

Andy,
I like to use an unbound combobox to "find" records. I would display all
the IDNos in the combo, and when the user selects an IDNo,... or hand enters
one, then use that value to do a FindRecord.
Use the AfterUpdate event of the combo box to initiate the FindRecord,
and refer to the value in the combo box in the FindRecord function.
 
J

Jan Pit

Andy,

Suppose the name of your IDNO control on your form is "xIDNO"
Put on your form two new controls:
= an unbound Textbox. Let name it "FndCod"
= a Command button.
In the onclick event of the command button you put the follwing code:
Dim sCod as String
If len(FndCod) > 0 then
sCod = FndCod
Me!xIDNO.SetFocus
On Error Resume Next
DoCmd.FindRecord sCod
On Error GoTo 0
End If

Works pretty well.

+ Jan Pit +
Information Management
Gaborone - Botswana
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top