Results 1 to 6 of 6
  1. #1
    New Lounger
    Join Date
    Jan 2008
    Location
    Australia
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Not writing to tables (2003)

    I have just created a new dB, created tables, relationships, indexes, primary keys (autonumber) etc. When I try to write to it via code, nothing is input but the record must have been written as the key increase as When I enter manually into the table, you can see it with the key increase. I use ADO and here is a snippet of the code.

    Dim rstMFD As ADODB.Recordset
    Set rstMFD = New ADODB.Recordset

    With rstMFD
    .Open "tblMFD", CurrentProject.Connection, adOpenDynamic, adLockBatchOptimistic, adCmdTable
    If mlngMFDID = 0 Then
    .AddNew
    !ManufacturerID = Me.cmbMfr
    !ModelID = Me.cmbModel
    !SerialNumber = Me.txtSerialNbr
    !MachineTypeID = Me.cmbType
    .Update
    mlngMFDID = !MFDID
    Else
    .Find "MFDID = " & mlngMFDID
    !ManufacturerID = Me.cmbMfr
    !ModelID = Me.cmbModel
    !SerialNumber = Me.txtSerialNbr
    !MachineTypeID = Me.cmbType
    .Update
    End If
    .Close
    End With

    Has anyone got an idea why this is not writing to file?

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Not writing to tables (2003)

    At a first glance, I don't see anything wrong with the code, so I'd have to see the database.

    Could you post a stripped down copy of your database? See <post#=401925>post 401925</post#> for instructions.

  3. #3
    New Lounger
    Join Date
    Jan 2008
    Location
    Australia
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Not writing to tables (2003)

    Hans

    Sorry to take so long. I have been experimenting between 2007 & 2003. With 2003, the problem seems solved but when I use exactly the same references (except Office 11 instead of Office 10) in 2007, the problem resurfaces & it will not write to file.

  4. #4
    New Lounger
    Join Date
    Jan 2008
    Location
    Australia
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Not writing to tables (2003)

    'Nother really silly question...... (definitely an ID 10 T)

    How does one attach a file when there is no button apparent?

  5. #5
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Not writing to tables (2003)

    In Access 2007, you should use a reference to the Microsoft Office 12.0 Object Library.

    Version 10.0 is for Office XP, 11.0 for Office 2003 and 12.0 for Office 2007.

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Not writing to tables (2003)

    Below the area where you compose your post or reply, there is a box labeled "Attach a file - 100k Max.".
    Click the Browse... button to select the file that you want to attach.
    The path and file name will appear in the box.
    The list of permitted extensions is displayed below the box.
    When you click the Post It button, the file will be attached to your post/reply.
    Attached Images Attached Images
    • File Type: png x.png (3.2 KB, 0 views)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •