> Does table [Formated Detail Information] have other fields in it that are
> marked as Required?
>
> --
> Doug Steele, Microsoft Access MVP
>
http://I.Am/DougSteele> (no e-mails, please!)
>
>
> "DONNA" <DONNA[ at ]discussions.microsoft.com> wrote in message
> news:567B3030-ADE3-47EB-8679-737C5F7B96E0[ at ]microsoft.com...
> > Thanks! That solved the problem. I still receive the following message
> > after the insert is complete: Invalid use of Null.
> >
> > Any idea what is causing this message?
> >
> >
> > "Douglas J. Steele" wrote:
> >
> >> The quotes are likely coming from the multiple double-quotes you've got.
> >>
> >> Try:
> >>
> >> DoCmd.RunSQL "INSERT INTO [Formated Detail Information](FIELD) " & _
> >> "SELECT (""" & linedata & tmpReferenceNumber & linedata1 & tmpDate &
> >> """) AS FIELD;"
> >>
> >>
> >> --
> >> Doug Steele, Microsoft Access MVP
> >>
http://I.Am/DougSteele> >> (no e-mails, please!)
> >>
> >>
> >> "DONNA" <DONNA[ at ]discussions.microsoft.com> wrote in message
> >> news:07F48637-7402-4405-A801-946F952EC577[ at ]microsoft.com...
> >> >
> >> > The value I need inserted into FIELD is: TRS*T3*105*081031
> >> >
> >> > The value that is inserted into FIELD after running the code:
> >> > TFS*T3*"105"*"081031 (notice the extra quote marks)
> >> >
> >> > Also receiving the message: Invalid use of Null
> >> >
> >> > What am I doing wrong? Thanks for your help.
> >> >
> >> > THE CODE:
> >> >
> >> > Private Sub Command17_Click()
> >> > On Error GoTo Err_Command17_Click
> >> >
> >> > Dim LineCount As Variant
> >> > Dim tmpReferenceNumber As String
> >> > Dim tmpDate As String
> >> > Dim linedata As String
> >> > Dim linedata1 As String
> >> >
> >> > DoCmd.OpenQuery "Clear Formated Detail Information"
> >> >
> >> > LineCount = 2
> >> > Set dbCurrent = CurrentDb
> >> >
> >> > strSQL = "SELECT * FROM [Detail Table];"
> >> > Set rsTemp = dbCurrent.OpenRecordset(strSQL)
> >> > If rsTemp.RecordCount > 0 Then
> >> > Do Until rsTemp.EOF
> >> > tmpReferenceNumber = rsTemp.Fields(0)
> >> > tmpDate = rsTemp.Fields(1)
> >> >
> >> > linedata = "TFS*T3*"
> >> > linedata1 = "*"
> >> > DoCmd.RunSQL "INSERT INTO [Formated Detail
> >> > Information](FIELD)
> >> > SELECT (""" & linedata & """""" & tmpReferenceNumber & """""" &
> >> > linedata1
> >> > &
> >> > """""" & tmpDate & """) AS FIELD;"
> >> > LineCount = LineCount + 1
> >> > rsTemp.MoveNext
> >> >
> >> > Loop
> >> >
> >> > End If
> >> >
> >> > Exit_Command17_Click:
> >> > Exit Sub
> >> >
> >> > Err_Command17_Click:
> >> > MsgBox Err.Description
> >> > Resume Exit_Command17_Click
> >> >
> >> > End Sub
> >> >
> >>
> >>
> >>
>
>
>