Re: Inserting empty items into a field.
- From: Marshall Barton <marshbarton@xxxxxxxxxx>
- Date: Mon, 22 May 2006 16:21:02 -0500
ED007 wrote:
I am using the SQL statement below to insert a record into a table. The
statement works fine if K contains a value. (both [ASH VALUE], AND [BULK
DENSITY] are double data types.) But I often want to set one or both to
empty/null. I seem to be able to do this if i edit the table manualy by
deleting the entry in those fields but how do I do it with the SQL statement.
Can I "set K to null somehow?
strSQL = "INSERT INTO [LOT QC DATA] " _
& "([COMPOUND LOT], DRUM, SAMPLE,[ASH VALUE],[BULK DENSITY]) " _
& "SELECT " _
& "'" & Me.LOT & "'" & "," & i & "," & j & "," & K & "," & K & ";"
Just set K to the string "Null" so the final SQL statement
looks something like:
INSERT INTO [LOT QC DATA] ([COMPOUND LOT], DRUM, SAMPLE,
[ASH VALUE], [BULK DENSITY])
SELECT '1234', 12, 34, Null, Null
--
Marsh
MVP [MS Access]
.
- Prev by Date: Re: Inserting empty items into a field.
- Next by Date: Re: Option Explicit Statement
- Previous by thread: Re: Inserting empty items into a field.
- Next by thread: Re: Option Explicit Statement
- Index(es):
Relevant Pages
|