Hi
I'm trying to open FORM2 pointing to a record that was selected in FORM1.
In FORM2's ON LOAD property, I have the following code
When I make a selection on FORM1, FORM1 hides, FORM2 opens, but I get an error message that "he Microsoft Jet database engine does not recognize 'ctlGapNum'."
Any suggestions/ideas would be appreciated.
Thanks!
Jim DeGeorge![[wavey] [wavey] [wavey]](/data/assets/smilies/wavey.gif)
I'm trying to open FORM2 pointing to a record that was selected in FORM1.
In FORM2's ON LOAD property, I have the following code
Code:
Me.RecordSource = "SELECT tblGaps.* FROM tblGaps WHERE tblGaps.DateClosed Is Null " _
& "AND tblGaps.Conversion = [Forms]![frmSignOn]![ctlConversion] " _
& "ORDER BY tblGaps.[Gap#];"
Me.msgContraContact.Visible = False
Me.msgContact.Visible = False
Me.msgOwner.Visible = False
Me.msgNewOwner.Visible = False
Dim db As dao.Database, rs As dao.Recordset, rsNUM As dao.Recordset, sql As String, frm As Form, rst As dao.Recordset
sql = "SELECT Count(tblGaps.GapID) AS vCount FROM tblGaps "
sql = sql & "WHERE tblGaps.Gap_Status = 1 And tblGaps.Conversion = '" & [Forms]![frmSignOn]![ctlConversion] & "';"
Set db = CurrentDb()
Set rs = db.OpenRecordset(sql, dbOpenDynaset)
Set frm = Forms!frmGapEditSelection
Set rst = Me.RecordsetClone
If rs!vcount = 0 Then
DoCmd.Close acForm, Me.NAME, acSaveYes
[Forms]![frmGapMenu].Visible = True
Dim msg1, DgDef1, Response1 As Variant
Beep
msg1 = "There is nothing to edit for this option." _
& vbCrLf & "Click OK to return to the previous menu. Thank you!"
DgDef1 = MB_OK + MB_ICONINFORMATION + MB_DEFBUTTON2
Response1 = MsgBox(msg1, DgDef1, Title)
Else
Me!lblClock.Caption = Format(Now, "dddd, mmmm d, yyyy, hh:mm:ss AMPM")
Me.TimerInterval = 1000
rst.FindFirst "[ctlGapNum] = " & frm![ctlGapNumSelect]
Me.Bookmark = rst.Bookmark
End If
Set db = Nothing
Set rs = Nothing
Set frm = Nothing
Set rst = Nothing
When I make a selection on FORM1, FORM1 hides, FORM2 opens, but I get an error message that "he Microsoft Jet database engine does not recognize 'ctlGapNum'."
Any suggestions/ideas would be appreciated.
Thanks!
Jim DeGeorge
![[wavey] [wavey] [wavey]](/data/assets/smilies/wavey.gif)