search using the binoculars

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi everyone
When I search using the binoculars on combo Box - I'm getting a message that
there are no results. And yet - I can see the record I'm looking for right in
front of me? What am I doing wrong?

Barb
 
Hi Crystal
No, I did not make this mistake (learned on previous database)
But my row source for this combo box is complex, maybe a mistake is here?
Could you help?
SELECT tblSectors.GPNB, [tblProgram]![Program] & " : " &
[tblSectors]![SectorNameLong] AS Sector
FROM tblDivision INNER JOIN (tblProgram INNER JOIN tblSectors ON
tblProgram.Program = tblSectors.Program) ON tblDivision.DivisionID =
tblSectors.Division
WHERE (((tblDivision.DivisionID)=[Forms]![frmDivision]![txtDivision]))
ORDER BY tblSectors.GPNB;

thanks
Barb
 
Hi Barb,

Is your combobox bound? If not, perhaps you should be doing
something like this:

put this behind your form and substitute for IDfield

ideally, the first (and probably hidden) column of your
combobox would be the Autonumber ID field for the table.

-----------------
Private Function FindRecord()

If IsNull(Me.ActiveControl) Then Exit Function

'save current record if changes were made
If me.dirty then me.dirty = false

Dim mRecordID As Long
mRecordID = Me.ActiveControl
Me.ActiveControl = Null
Me.RecordsetClone.FindFirst "IDfield = " & mRecordID

If Not Me.RecordsetClone.NoMatch Then
Me.Bookmark = Me.RecordsetClone.Bookmark
Exit Function
End If

End Function
-----------------

this would go on the AfterUpdate event of your search
combobox -->
=findRecord()



Have an awesome day

Warm Regards,
Crystal

MVP Microsoft Access
strive4peace2006 at yahoo.com


Hi Crystal
No, I did not make this mistake (learned on previous database)
But my row source for this combo box is complex, maybe a mistake is here?
Could you help?
SELECT tblSectors.GPNB, [tblProgram]![Program] & " : " &
[tblSectors]![SectorNameLong] AS Sector
FROM tblDivision INNER JOIN (tblProgram INNER JOIN tblSectors ON
tblProgram.Program = tblSectors.Program) ON tblDivision.DivisionID =
tblSectors.Division
WHERE (((tblDivision.DivisionID)=[Forms]![frmDivision]![txtDivision]))
ORDER BY tblSectors.GPNB;

thanks
Barb

:

you probably have the field defined as a Lookup in your
table design, you should not do this

http://www.mvps.org/access/lookupfields.htm

Have an awesome day

Warm Regards,
Crystal

MVP Microsoft Access
strive4peace2006 at yahoo.com
 
Back
Top