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:
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:
and
None of those worked
Anyone smarter than I?
Chris
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