Problem with linked forms

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have two forms that are linked by a field named "NSL". When the user
double-clicks on the NSL list box in the first form, the data is then copied
over to a second form. However, I recently had to amend the field's data
type from numeric to text and now the link program no longer works, failing
at the FindFirst command. Does anyone know an alternative method that could
accommodate this new data type?

My current code for the NSL list box's DoubleClick event is listed below.

Private Sub List0_DblClick(Cancel As Integer)
Dim ListForm As Form
Dim List As DAO.Recordset
DoCmd.OpenForm FormName:="frmOrderENSL"
Set ListForm = Forms("frmOrderENSL")
Set List = ListForm.RecordsetClone
List.FindFirst "NSL = " & Me.List0
ListForm.Bookmark = ListForm.RecordsetClone.Bookmark
End Sub

Regards,

Jedster
 
Jedster,

Having changed the NSL field type to Text, you should also change the
FindFirst statement in your code accordingly:

List.FindFirst "NSL = '" & Me.List0 & "'"

HTH,
Nikos
 
Back
Top