Page 3 of 3 FirstFirst 123
Results 31 to 39 of 39
  1. #31
    jc1234 is offline Novice
    Windows XP Access 2007
    Join Date
    May 2010
    Posts
    25

    Quote Originally Posted by RuralGuy View Post
    I'm sorry, I should have been clearer. It is really quite simple. The form has a RecordSource on the Data tab of the property sheet. Instead of pointing to the table, you point to the Query. You're Done.
    Ok cool. I changed the record source to the query and then had to change the control source on a few fields to the table. Everything works fine now. One last question (I promise). If I close out of the form and re-open all fields are set in the order that I want them, then I just press the button and it renumbers and gets rid of any duplicates or out of sequence numbers. How come it requires that I close out of the form before the rows are ordered by date and doesnt update on a save, is it that the query cant run on an open form?

  2. #32
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 Access 2007
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    It should keep the rows ordered by date if you have set that in the query. How about posting the SQL for the query here so I can see it?

  3. #33
    jc1234 is offline Novice
    Windows XP Access 2007
    Join Date
    May 2010
    Posts
    25
    Quote Originally Posted by RuralGuy View Post
    It should keep the rows ordered by date if you have set that in the query. How about posting the SQL for the query here so I can see it?
    SELECT [Schedule Status].*, [Schedule Status].[Scheduled Completion], [Schedule Status].[DAC & DSP Name], [Schedule Status].[Deliverable Description]
    FROM [Schedule Status]
    ORDER BY [Schedule Status].[Scheduled Completion], [Schedule Status].[DAC & DSP Name], [Schedule Status].[Deliverable Description];


    I just checked and if I close and reopen the query without saving the form it does update, but neither the form or query will update when open, at least not visibly to me.

  4. #34
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 Access 2007
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Let's put in a Requery instead of the .MoveFirst and see what happens.
    Code:
    Private Sub cmdRenumber_Click()
    Dim Sequence As Long
    With Me.Recordset
       .MoveFirst
       Do While Not .EOF
          Sequence = Sequence + 1
          .Edit
          !RecNum = Sequence
          .Update
          .MoveNext
       Loop
       Me.Requery
    End With
    End Sub

  5. #35
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 Access 2007
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    BTW, SELECT [Schedule Status].* will select *all* of the fields so you are actually selecting three of the fields twice with:
    SELECT [Schedule Status].*, [Schedule Status].[Scheduled Completion], [Schedule Status].[DAC & DSP Name], [Schedule Status].[Deliverable Description]

  6. #36
    jc1234 is offline Novice
    Windows XP Access 2007
    Join Date
    May 2010
    Posts
    25
    The new function does reorder the records according to the query, but they remain out of number sequence.

    If I dont select *, then a number of columns in the form show as #NAME?

    Is it possible to requery before changing the sequence? I tried to change the function, but put it into a continual loop..oops.

  7. #37
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 Access 2007
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Try this:
    Code:
    Private Sub cmdRenumber_Click()
    Dim Sequence As Long
    Me.Requery '-- Start by refreshing the recordset
    With Me.Recordset
       .MoveFirst
       Do While Not .EOF
          Sequence = Sequence + 1
          .Edit
          !RecNum = Sequence
          .Update
          .MoveNext
       Loop
       Me.Requery
    End With
    End Sub

  8. #38
    jc1234 is offline Novice
    Windows XP Access 2007
    Join Date
    May 2010
    Posts
    25
    Quote Originally Posted by RuralGuy View Post
    Try this:
    Code:
    Private Sub cmdRenumber_Click()
    Dim Sequence As Long
    Me.Requery '-- Start by refreshing the recordset
    With Me.Recordset
       .MoveFirst
       Do While Not .EOF
          Sequence = Sequence + 1
          .Edit
          !RecNum = Sequence
          .Update
          .MoveNext
       Loop
       Me.Requery
    End With
    End Sub
    That did it Thanks again.

  9. #39
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 Access 2007
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Glad we could help.

Page 3 of 3 FirstFirst 123
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Delete all records in a field
    By cotri in forum Forms
    Replies: 6
    Last Post: 01-29-2010, 02:44 PM
  2. Replies: 0
    Last Post: 07-19-2009, 12:19 PM
  3. Replies: 0
    Last Post: 12-25-2008, 10:05 AM
  4. addition with 0
    By Peljo in forum Access
    Replies: 0
    Last Post: 02-28-2008, 08:12 PM
  5. Form - Datasheet View
    By kalove in forum Forms
    Replies: 0
    Last Post: 06-20-2007, 11:29 AM

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