Full Version: Missed Something
UtterAccess Discussion Forums > Microsoft® Access > Access Forms
38JJC
I created a Form with 2 combo boxes that filter by Customer and then by the Customer Job Number. The Customer Job Number combo box's after update event showsl the records for that job.Coded as follows:

Private Sub cboBSCID_AfterUpdate()

DoCmd.ShowAllRecords
Me!txtBSCID.SetFocus
DoCmd.FindRecord Me!BSCID
Me.cboBSCID.Value = ""

End Sub

The problem is I'm getting all the customers job data, not the 1 job number chosen in Combo box cbo.BSCID.
The criteria in the BSCID field in the underlying query is set at Forms!Jobs.cobBSCID
fkegley
Is this correct?
DoCmd.FindRecord Me!BSCID

Shouldn't it be this?
DoCmd.FindRecord Me!cboBSCID
38JJC
I get a run time error with either,

Error 2162

A macro set to one of the current fields properties failed because of a an error in the FindRecord action argument.
38JJC
I Changed to form RecordSource to a query with the BSCID criteria set to the cboBSCID combo box, It seems to work fine.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.