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

Clone Reocrdset to query based on combo

Status
Not open for further replies.

mo2783

Programmer
Nov 16, 2003
68
GB
Hi

I have a combo box on a form which has values when a user selects a value i am running a SQL statement which brings the data.

I was wondering whether i could clone that recordset so the form is populate with the cloned data?

i have the following code

Code:
    Dim rsFoundSerachDescription As DAO.Recordset
    
    Dim strSQl As String
    
    strSQl = "SELECT ECRDatabase.*, ECRDatabase.ED_PartDescription " & _
    "FROM ECRDatabase " & _
    "WHERE (((ECRDatabase.ED_PartDescription)=" & Chr(34) & Combo484 & Chr(34) & ")); "

    Set rsFoundSerachDescription = PartDescriptionSerach(strSQl)

I would appreciate any help, to achieve this?

thanks

Mo
 
I am not quite sure what you wish to achieve. Can you not set the RecordSource of the form to strSQl?


Code:
strSQl = "SELECT ECRDatabase.*, ECRDatabase.ED_PartDescription " & _
    "FROM ECRDatabase " & _
    "WHERE ECRDatabase.ED_PartDescription)=" & Chr(34) & Combo484 & Chr(34)

Me.RecordSource=strSQ1
 
How are ya mo2783 . . .

Why bother with cloning. Just set the recordsource to the sql:
Code:
[blue] Me.RecordSource = strSQL[/blue]

Calvin.gif
See Ya! . . . . . .

Be sure to see thread181-473997
Also faq181-2886
 
Remou/TheAceMan

Thanks for the solution, exactly what i was looking for.

Mo



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top