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

RecordSet Clone from Combo problem

Status
Not open for further replies.

caman74

IS-IT--Management
Jan 1, 2005
67
NO
Hello!

I have a form called "Kunder"
Inside this form there is a combo called [SøkFirma].
(It is places in the top text window of the form)
This combo shows three values based on the query:
Code:
SELECT Kunder.Firmanavn, Kunder.Kode, Kunder.KundeNr FROM Kunder ORDER BY Kunder.Firmanavn, Kunder.Kode, Kunder.KundeNr;

In the same form, I also got several textboxes, e.g. [Firmanavn] and [KundNr].
(these are placed in the detail window of the form)

I would like to the form to open on the correct record, when selected from the combo.

E.g. if I select "Sanofi Synthelabo" in the combo, the form opens the record on "Sanofi Synthelabo"

This can't be so hard...

I've tryed the following codes:

Code:
Private Sub SøkFirma_AfterUpdate()
' Find the record that matches the control.
 Me.RecordsetClone.FindFirst "[Firmanavn] = " & Me![SøkFirma]
Me.Bookmark = Me.RecordsetClone.Bookmark
End Sub

and

Code:
Private Sub SøkFirma_AfterUpdate()
Dim rst As DAO.Recordset
   
   Set rst = Me.RecordsetClone
   
   rst.FindFirst "[Firmanavn] = " & Me![SøkFirma].Value
   Me.Bookmark = rst.Bookmark
   
   Set rst = Nothing


End Sub

None of those worked :(

Anyone smarter than I?

Chris
 
And this ?
rst.FindFirst "[Firmanavn] = " & Me![SøkFirma].Column(0)

Or this ?
rst.FindFirst "[Firmanavn] = '" & Me![SøkFirma].Value & "'"


Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Thank you again...

Tryed it, but forgot to use the parenthesis!

Chris
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top