Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Move to Different Record on Form - Access 2003 2

Status
Not open for further replies.

stephenj789

Technical User
Jan 28, 2002
58
US
I have a form with a subform. The subform is tied to field A, which is a textbox on the main form. When I change the value in field A to get a different record, the subform updates correctly, however, the other items on the main form don't update. I think that Access assumes that I am trying to change the current record, rather than trying to get to a different record.


Explained another way:

Field A: C321

I want to get to the record named C789, so I put C789 in field A, but the other fields on the main form don't update to record C789.

I think that I have to use a bookmark, but I tried this and was unable to get it to work.
 
A control used as a navigation tool shouldn't be bound to a field.
I'd use an unbound combo in the mainform's header section.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
How are ya stephenj789 . . .

In a typical secnario the subform is linked to the mainform thru [blue]Master/Child[/blue] link properties. With this setup, [blue]changing to a different record in the mainform causes the subform to follow along[/blue]. With your [blue]unbound[/blue] field A textbox in the forms header, typical code in the [blue]AfterUpdate[/blue] event of that textbox would look like:
Code:
[blue]   [green]'[B][I]tbxGoto[/I][/B] is a substitute for your field A textbox
   '[B][I]tbxSearch[/I][/B] is a substitute name the field your searching[/green]
   
   Dim rst As DAO.Recordset
   
   Set rst = Me.RecordsetClone
   rst.FindFirst "[TextboxName] = '" & Me!tbxGoto & "'"
   
   If Not rst.NoMatch Then
      Me.Bookmark = rst.Bookmark
   Else
      MsgBox "Record Not Found!"
   End If
   
   Set rst = Nothing[/blue]

See Ya! . . . . . .

Be sure to see thread181-473997 [blue]Worthy Reading![/blue] [thumbsup2]
Also faq181-2886 [blue]Worthy Reading![/blue] [thumbsup2]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top