M
Mark Kubicki
I'm trying to add some code that would add a record to a table
[tblInstallationNotes] based on the selection of a combobox
[cmbInstallationNoteSelection]
the fields to be added in the destination table [tblInstallationNotes] are:
PrintInstallationNote - Yes/No
BaseInstallationNote - Yes/No
InstallationNote - memo
Type - text
in source table [OptInstallationNotes] the fileds are:
OptionNumber - AutoNumber
InstallationNoteTitle - Text
Options - Memo
the Field [Type]is filled with the current entry on the form [Spec] in the
field [Type] (which is text)
of course, it's not working; would someone take a look over my shoulder -i
may be missing the obvious
-------------------------------------------------
Dim sSQL As String
sSQL = "INSERT INTO tblInstallationNotes (PrintInstallationNote,
BaseInstallationNote, InstallationNote, Type) " & _
"SELECT True, False, Options, '" & Forms![Spec].[Type] & _
"', from OptInstallationNotes where OptionNumber = " &
[cmbInstallationNoteSelection] & ";"
DoCmd.SetWarnings False
CurrentDb.Execute (sSQL), dbFailOnError
DoCmd.SetWarnings True
[tblInstallationNotes] based on the selection of a combobox
[cmbInstallationNoteSelection]
the fields to be added in the destination table [tblInstallationNotes] are:
PrintInstallationNote - Yes/No
BaseInstallationNote - Yes/No
InstallationNote - memo
Type - text
in source table [OptInstallationNotes] the fileds are:
OptionNumber - AutoNumber
InstallationNoteTitle - Text
Options - Memo
the Field [Type]is filled with the current entry on the form [Spec] in the
field [Type] (which is text)
of course, it's not working; would someone take a look over my shoulder -i
may be missing the obvious
-------------------------------------------------
Dim sSQL As String
sSQL = "INSERT INTO tblInstallationNotes (PrintInstallationNote,
BaseInstallationNote, InstallationNote, Type) " & _
"SELECT True, False, Options, '" & Forms![Spec].[Type] & _
"', from OptInstallationNotes where OptionNumber = " &
[cmbInstallationNoteSelection] & ";"
DoCmd.SetWarnings False
CurrentDb.Execute (sSQL), dbFailOnError
DoCmd.SetWarnings True