Locate, Display and add New Record Help

jcwillette

Registered User.
Local time
Today, 00:41
Joined
Jan 19, 2009
Messages
23
I have a database that has 2 forms, one ain form and a continuous subform displayed on the same screen. I am able to search for a record and display the results for that record in the main and sub forms, but I have to tab trhough all the fields on the main form to get to the subform. :( What I would like to do is display all the info in both forms and have the cursor be on a new record in the subform. :p When I tab through the fields it is doing this but I want to get rid of the tabbing. Any ideas?


Here is my coding:

Private Sub Search_AfterUpdate()
Dim rs As DAO.Recordset
If Not IsNull(Me.Search) Then
' Save before move.
If Me.Dirty Then
Me.Undo
Me.Dirty = False
End If


' Search in the clone set.
Set rs = Me.Recordset.Clone
rs.MoveFirst
rs.FindFirst "[License] = """ & Me![Search] & """"

If rs.NoMatch Then
DoCmd.Beep
' Take Search results and place them in the License box
DoCmd.GoToRecord , , acNewRec
License = Search
Me.State.SetFocus
MsgBox "License not found in Database!"

Else
' Display record in the form
Me.Bookmark = rs.Bookmark
rs.MoveLast

End If
Set rs = Nothing

End If
End Sub

Please give me a hand on this. It has been bugging me for about 2 weeks now. Thanks for you help in advance.

JC Willette
 
JC,

I am sorry. I read your post incorrectly. I only gave you half the answer. Your question is, how to End Up at the point at which you want to enter a new record in the subform, and having the focus on the relevant subform control of your choice upon filtering. First of all, I have already hashed this out with Nigel Shaw here: http://www.access-programmers.co.uk/forums/showthread.php?t=145533

Read through the last couple of posts. I found the answer on my own to this. To get this done, you have to go through incredibly redundant steps for the subform to react correctly. Don't ask me why, it's a bit stupid, but it has always worked for me. If you can't get it to work by reading through the posts on the link, post the DB and I'll (or someone will) fix it.
 

Users who are viewing this thread

Back
Top Bottom