Selecting specific record to display in form view

  • Thread starter Thread starter Jenny Burt
  • Start date Start date
J

Jenny Burt

I have set up an access 2000 database. From a simple
comand button on click opens my table in form view.
The record data displayed is by default the first record
in the table. I want to know how to display any record
from the table by typing the known ref no in a field

eg quote no - to bring up all the data for that record
only. I can do it from a combo or list box but the data
rolls around when you scroll on the form or hit enter keys
etc.
How can the info for the displayed form stay together
until exit.
The other way i would like to bring up a specific record
is to open a blank form then enter the quote/ref no and
display the rest of the record info automatically to
edit/lookat but i dont know how to design a blank form.

At the moment to bring up a specific record I use the
control find box, but this is cumbersome as you have to
close this to view or edit the information. What i really
want is to be able to just type in the ref no and hey
presto!

Can some very helpful person help?

Cheers Jenny
 
Jenny, the crucial thing is to use a different control to navigate to the
record you want. Don't try to use the same control for data entry and also
for navigating to a record.

Place a combo or text box on your form, preferably in the Form Header
section (View menu) so the user can see it's not part of the record.
Consider using a different colour background as well. Make sure this control
is unbound (i.e. there is nothing in its Control Source property).

Set the AfterUpdate property to [Event Procedure], including the square
brackets.
Click the build button (...) beside this.
Access opens the code window.
Set up the code so it looks like this:

Private Sub txtFindQuote_AfterUpdate()
Dim strWhere As String
If Not IsNull(Me.txtFindQuote) Then
If Me.Dirty Then 'Save first.
Me.Dirty = False
End If
strWhere = "[quote no] = " & Me.txtFindQuote
With Me.RecordsetClone
.FindFirst strWhere
If .NoMatch Then
MsgBox "Not found"
Else
Me.Bookmark = .Bookmark
End If
End With
End If
End Sub
 
-----Original Message-----
I have set up an access 2000 database. From a simple
comand button on click opens my table in form view.
The record data displayed is by default the first record
in the table. I want to know how to display any record
from the table by typing the known ref no in a field

eg quote no - to bring up all the data for that record
only. I can do it from a combo or list box but the data
rolls around when you scroll on the form or hit enter keys
etc.
How can the info for the displayed form stay together
until exit.
The other way i would like to bring up a specific record
is to open a blank form then enter the quote/ref no and
display the rest of the record info automatically to
edit/lookat but i dont know how to design a blank form.

At the moment to bring up a specific record I use the
control find box, but this is cumbersome as you have to
close this to view or edit the information. What i really
want is to be able to just type in the ref no and hey
presto!

Can some very helpful person help?

Cheers Jenny
.
Try creating a "select query" where the field you want to
select shows in the criteria box (select record) where
record is the data you want to go to. Hope this makes
sense.
Speedy
 
Back
Top