Results 1 to 3 of 3
  1. #1
    vojinb is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Jul 2011
    Posts
    18

    fulfilling empty rows


    Hi,
    I have column in table (integer type) where I have values like

    1001
    -blank-
    -blank-
    1002
    -blank-
    -blank-
    1003

    What I want to do is to fullfill blank rows in next manner:
    between 1001 and 1002 all blank values to be 1001
    between 1002 and 1003 all blank values to be 1002 and so on,
    but query
    "update table set field =1001 where field between 1001 and 1002" not working,it is same when I try with > and <

  2. #2
    AndreT is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Jan 2011
    Posts
    25
    If you have only one column in this table, you're doomed. In a spreadsheet, you can drag each number down to a specific cell, but Access is a relational db which applies every action to all records.

    If you have an autonumber ID, or some kind of key for this table like:
    (1, 1001)
    (2, blank)
    (3, blank)
    (4, 1002)
    (5, blank)
    (6, blank)
    (7, 1003), etc.
    There is still hope.

    Do you have anything to identify a row?

  3. #3
    vojinb is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Jul 2011
    Posts
    18
    Hi, i have already solved the problem with next code:

    Dim rs As DAO.Recordset
    Dim currentValue As Long

    Set rs = CurrentDb.OpenRecordset("select * from tblData order by ID")

    With rs

    Do Until .EOF
    If IsNull(!myInteger) Then
    .Edit
    !myInteger = currentValue
    .Update
    Else
    currentValue = !myInteger
    End If
    .MoveNext

    Loop

    End With

    Set rs = Nothing

    Thanks for help

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Empty Subreport
    By runbear in forum Reports
    Replies: 5
    Last Post: 04-23-2011, 12:26 PM
  2. empty field
    By amber mara in forum Access
    Replies: 2
    Last Post: 05-05-2010, 01:46 PM
  3. Getting Rid of Empty Space
    By Pam Buckner in forum Database Design
    Replies: 5
    Last Post: 03-05-2010, 05:46 PM
  4. Empty Lookup
    By mikel in forum Access
    Replies: 39
    Last Post: 08-07-2009, 01:00 PM
  5. How to get rows with empty fields as well?
    By Orabidoo in forum Queries
    Replies: 10
    Last Post: 04-24-2009, 06:08 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums