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

3070 Error Message 2

Status
Not open for further replies.

Smeg77

Technical User
Oct 7, 2009
18
GB
Can someone possibly help with this.

I've done a bit of looking around and I can't find something that quite matches my problem.

This is the code I'm using;

Code:
Dim L As Recordset

Set L = Me.RecordsetClone
L.FindFirst "[tblStolen]![ID] = " & Me![Combo_Stolen_Lookup]
Me.Bookmark = L.Bookmark

What I'm trying to do is get the Combo Box on my form to return the corrresponding record from the table. I've used exaclty the same query for some of my other forms with no problems.

The Combo Box is bound to Coloumn 1 (ID Field) in the query, and the ID field from the Table is an Autonumber, so as far as I can tell I don't need to used the ' (single quotes) as I'm not trying to bring back a string value.

The Full Error Message I'm getting it;

Run-time error '3070':

The Micrsoft Jet database engine does not recognize 'tblStolen!ID' as a valid field name or experssion.

Any help would be much appreciated.
 
dhookom thanks that worked.

I have to admit I'd tried everything I could think of apart from doing that :)
 
You may even replace the 4 lines of code with a single one:
Code:
Me.Recordset.FindFirst "ID=" & Me!Combo_Stolen_Lookup

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
PHV

Thanks for that, also does the trick nicely, and with a fraction of the lines of code :)

It's been too long since I've had to play around with all this stuff, so at most of my code is done in a logical fashion which also mean lots of un-necessary lines of code.
 
Some times having more lines of code helps with being able to decipher what your code is doing. Adding lines of comments is recommended especially when you get to my age ;-)

"un-necessary lines of code" is in the eye of the beholder.

Duane
Hook'D on Access
MS Access MVP
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top