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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Why do I get Runtime error 3021 on a combi box look up

Status
Not open for further replies.

RosemaryMD

Programmer
Jul 11, 2003
4
GB
Using a combi box in a form on Access 97 to lookup records , when I click an item from the drop down box, Error 3021 (No current record) is displayed . Obviously the record does exist. I've removed any filters from the form & the subform and also deleted the combi box & recreated it. Coding looks fine. still no joy
 
can u paste what u have as the rowsource in ur combo box, or the code u are using so people can tell u if there is a mistake there (most probably there is!)
 
ERROR ON COMBO BOX


Generated code by Combo box wizard

Sub Combo22_AfterUpdate()
' Find the record that matches the control.
Me.RecordsetClone.FindFirst "[ID] = " & Me![Combo22]
Me.Bookmark = Me.RecordsetClone.Bookmark
End Sub

With Row source

SELECT DISTINCTROW[Full Address List].[ID],[Full Address List].[FullAddr] from [Full Address List]




ON the form:-

Combo Box is looking up field FullAddr , when you start typing in an address, the drop down list appears to pick a record from (so it must exist) , but when one is chosen , the error message appears. There is the same lookup for a
view only form & this 2nd one works








 
I dunno know if this is your mistake but shouldnt there be a space in after distinctrow

SELECT DISTINCTROW [Full Address List].[ID],[Full Address List].[FullAddr] from [Full Address List]
 
It worked for me in a test run... as long as ID was a numeric field (otherwise you need to add the delimiters)


PaulF
 
Not sure if lst msg recvd so here it is again

the SELECT statement was generated by the COMBO wiz , so my mistake in trying to copy it

 
make sure the ComboBox is Bound to the Column with the ID field

PaulF
 
Solved Problem by Recreating Form from scratch based on the same table & with a new Combo Box. There must have been some corruption taking place. Now OK

Thanks for your responses
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top