Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms Programming / March 2007

Tip: Looking for answers? Try searching our database.

subform combo lookup

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Starry - 29 Mar 2007 12:50 GMT
My mainform lookup combo (cmbJobfind) finds a subform record based on
selection and works great until I click on a subform record then it stops
working but gives no error. If I change the mainform record the combo values
change (as they should) along with the records displayed in the subform but
the (cmbJobfind)still fails to do its job. Provided that I don't click on a
record it works fine regardless of any main form changes.

Code
Private Sub cmbJobfind_AfterUpdate()
Dim strJobnum As String

strJobnum = Me.cmbJobfind.Value
   Me.Jobs.SetFocus
   DoCmd.FindRecord strJobnum, acEntire, False, , False, acCurrent, True
   'Me.SetFocus <just guessing that mainform needed focus but makes no
difference
End Sub

No doubt I'm just being a bit dim please show me where thanks.
Starry - 29 Mar 2007 13:35 GMT
I was being dum! I missed the acCurrent property in my Findrecord command.
If I clicked in a alternative field to the one that the combo uses then of
course it is no longer valid so keeping acCurrent to speed the search I just
shifted the focus back to the correct field first

Private Sub cmbJobfind_AfterUpdate()
Dim strJobnum As String

strJobnum = Me.cmbJobfind.Value
   Me.Jobs.SetFocus
   Forms![Clients]!Jobs.Controls!txtJobNumber.SetFocus
   DoCmd.FindRecord strJobnum, acEntire, False, , False, acCurrent, True
End Sub

thought this may help someone else any further comment welcome.

> My mainform lookup combo (cmbJobfind) finds a subform record based on
> selection and works great until I click on a subform record then it stops
[quoted text clipped - 15 lines]
>
> No doubt I'm just being a bit dim please show me where thanks.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.