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

Search Form Question

Status
Not open for further replies.

HJessen

Technical User
Dec 18, 2002
39
US
I am trying to recreate the wheel , as the saying goes. I have access to a form that has an unbound combo box where a code is entered and the resultant search gives you the rest of the info.

We are trying to do the same thing for our applicaion, however, we enter an airline code instead. The "After Update" code is suppose to complete the rest of the form which give the airline code and the airline name.

Problem is we can't get it to work for us. The "After Update" code is:

Private Sub Combo4_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object

Set rs = Me.Recordset.Clone
rs.FindFirst "[Data-Airlines].[ID] = " & Str(Me![Combo4])
Me.Bookmark = rs.Bookmark
End Sub


The row source is:

SELECT [DATA-Airlines].[ID], [DATA-Airlines].[Airline_Code] FROM [DATA-Airlines];


The error message is:

Run Time Error '3070':
The Microsoft Jet Database engine does not recognize
'DATA-Airlines.ID' as a valid field name or expression.



Any help appreciated.



H. Jessen
"Now I know more, and I feel dummer"
 
I think you have a typo in the following statement:

Set rs = Me.Recordset.Clone

Take the red period out. It should read like this:

Set rs = Me.RecordsetClone

Good luck.

Bob Scriver
 
Hi,

You will probably be better off using the DLOOKUP Function (see the Access VB Code help for more info). It is alot cleaner and easier to use for searching for a matching record. Hope this helps,

jbehrne
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top