Originally Posted by
markjkubicki
the first message box ("Option (criteria) selected is ") is displayed;
but, nothing afterwards (including the second: "Number of records = ")
I checked the spelliong of tblFixtureSchedulePrintOptions, PresetOption, and frmPresetOption - all are correct, and frmPresetOption is a number field
OK, Try this:
Code:
Dim sSQL As String
'==============================
'for testing
'==============================
Dim R as DAO.Recordset
Dim RC as Long 'record count
MsgBox "Option (criteria) selected is " & Me.frmPresetOption
sSQL = " SELECT *" _
sSQL = sSQL & " FROM tblFixtureSchedulePrintOptions"
sSQL = sSQL & " WHERE [PresetOption] = " & Me.frmPresetOption & ";"
MsgBox "sSQL = " & sssql
' open recordset
'my spelling error
Set R = Currentdb.OpenRecordset(sSQL)
RC = R.Recordcount
R.Close
Set R = Nothing
MsgBox "Number of records = " & RC
'==============================
'end testing
'==============================
'clear table
sSQL = "Delete * from [tbeFixtureSchedulePrintOptions];"
CurrentDB.Execute sSQL, dbfailonerror
'append new record
sSQL = "INSERT INTO tbeFixtureSchedulePrintOptions" _
& " SELECT *" _
& " from tblFixtureSchedulePrintOptions" _
& " WHERE [PresetOption] = " & Me.frmPresetOption & ";"
MsgBox "Insert string = " & ssql
CurrentDB.Execute sSQL, dbfailonerror
'requery current form
Me.Requery
Do the sSQL strings look right??