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!

DoCmd.OpenForm Where Condition From Recordset 1

Status
Not open for further replies.

firsttube

Technical User
Apr 21, 2004
165
CA
I'm using an ADO recordset to search for record and then open a form based on the result...

rs3.movefirst
theID = rs3("ID")
DoCmd.OpenForm "theForm", acNormal, , "[ID] = ' & theID & '", acFormEdit


The problem is with the DoCmd.Openform line. Any ideas? How can I open a form based on the result of the recordset?

thanks

ft

Set the gearshift for the high gear of your soul, you've got to run like an antelope, out of control.
 
If ID is defined as numeric in the form underlaying table/query then get rid of the single quotes.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
You'll need to concatinate the string:
[tt]DoCmd.OpenForm "theForm", acNormal, , "[ID] = '" & theID & "'", acFormEdit ' for string
DoCmd.OpenForm "theForm", acNormal, , "[ID] = " & theID, acFormEdit ' for numeric[/tt]

Roy-Vidar
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top