Viewing Certain Records using a form.

  • Thread starter Thread starter andy
  • Start date Start date
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
 
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.
 
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
 
Back
Top