Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.databases.ms-access > #733

Opening a form to a specific record leads to #error for one field

From "buckskin" <buckskin@mailinator.com>
Newsgroups comp.databases.ms-access
Subject Opening a form to a specific record leads to #error for one field
Date 2011-04-01 01:45 +0100
Message-ID <8vklhiFn41U1@mid.individual.net> (permalink)

Show all headers | View raw


I'm opening a form like so;

strWhere = "[id] = " & lngRpt
DoCmd.openform "frmCC_Choice", , , , , acDialog, "usercodes"


The form opens and I run this form in the open event

'Dao code courtesy of Allen Browne in 2006

Dim rs As DAO.Recordset
With Forms!frmCC_Choice
    Set rs = .RecordsetClone
    rs.FindFirst strWhere
    If rs.NoMatch Then
        MsgBox "Not found"
    Else
        .Bookmark = rs.Bookmark
    End If
End With
Set rs = Nothing

Me.RecordSource = "SELECT report_defs.*, report_defs.Type,
report_defs.DateModified FROM report_defs WHERE (((report_defs.Type) =" &
"'C'" & ")) ORDER BY report_defs.DateModified DESC;"

This all works - nearly.  I can open the form at the record I require and
can then navigate the other records.
But the textbox bound to DateModified now shows #Error.

If I remove that sorting field from the recordsource then it displays ok.
It's obviously the sorting that screws things up (but I need it sorted).

Is there a quick fix?

Back to comp.databases.ms-access | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Opening a form to a specific record leads to #error for one field "buckskin" <buckskin@mailinator.com> - 2011-04-01 01:45 +0100
  Re: Opening a form to a specific record leads to #error for one field "buckskin" <buckskin@mailinator.com> - 2011-04-01 02:13 +0100
  Re: Opening a form to a specific record leads to #error for one field Salad <salad@oilandvinegar.com> - 2011-03-31 20:47 -0500
    Re: Opening a form to a specific record leads to #error for one field "buckskin" <buckskin@mailinator.com> - 2011-04-01 05:19 +0100
      Re: Opening a form to a specific record leads to #error for one field Salad <salad@oilandvinegar.com> - 2011-04-01 07:52 -0500
    Re: Opening a form to a specific record leads to #error for one field "buckskin" <buckskin@mailinator.com> - 2011-04-01 10:25 +0100

csiph-web