Open a form to a specified record

  • Thread starter Nicolae Fieraru
  • Start date
N

Nicolae Fieraru

Hi All,

I have a table called Table1 with Index(autonumber), Position(number).
I also have a main form where I have a text box and a button.
In the textbox I input a number representing a Position and I want to open a
form based on Table1 to the desired recordset. What I want is to be able to
browse through all the other records, not to have the records filtered. Any
sample code would be appreciated.

Regards,
Nicolae
 
E

Eric Wattez

You'll have to search recordset in vbcode and find which position in the
recordset the required field is. By moving to the field you'll keep other
records visible.

Regards,
Eric Wattez
 
D

Dirk Goldgar

Nicolae Fieraru said:
Hi All,

I have a table called Table1 with Index(autonumber), Position(number).
I also have a main form where I have a text box and a button.
In the textbox I input a number representing a Position and I want to
open a form based on Table1 to the desired recordset. What I want is
to be able to browse through all the other records, not to have the
records filtered. Any sample code would be appreciated.

Regards,
Nicolae

In Access 2000 or later, you can do something like this:

DoCmd.OpenForm "frmPositions"
With Forms!frmPositions.Recordset
.FindFirst "Position=" & Me.txtPosition
If .NoMatch Then
MsgBox "The position you entered doesn't exist."
End If
End With

In Access 97, you have to use the form's RecordsetClone property and
then synchronize using bookmarks.
 
Top