Results 1 to 8 of 8
  1. #1
    Join Date
    Aug 2003
    Posts
    5

    Unanswered: Displaying all records on a form

    I'm working with Access 97.

    Go to http://home.bellsouth.net/p/pwp-gregportal (or see atached file)
    Save the database db1.mdb onto your hard drive.

    I want the form in the database to display "grayed" check boxes if a user checks a box, exits the form and comes back in. Currently only the first record in the underlying table is read or shown as "grayed" on the form. I need all the records in the table to show accordingly on the form.

    You will have to save this database on your hard drive to be able to open it and, if necessary, covert it. It is in Access 97. Please help ASAP. Thank you!
    Attached Files Attached Files

  2. #2
    Join Date
    Jan 2003
    Location
    Aberdeen, Scotland, UK
    Posts
    168
    I'm not sure I know whta you mean. Do you mean that you want the database to not record their choices?

    Or do you want some defaults set?

    John

  3. #3
    Join Date
    Aug 2003
    Posts
    5
    Did you look at the database?

    I have times

    6-6:30
    6:30-7
    7-7:30
    7:30-8, etc.

    Consider this scenario. While in the form, I click the first 2 increments of times and click the Add Task button. When I exit the form and come back in, the 2 increments of time (6-6:30 and 6:30-7) are still grayed.

    When I click the next 2 increments of time (7-7:30 and 7:30-8), I want to be able to Add the Task, exit the form, and come back into the form and have all 4 increments of time grayed out.

    You must be able to open the database to be able to see what I'm talking about, otherwise it will be very difficult to understand what I mean. Thank you. Please respond ASAP.

  4. #4
    Join Date
    Jul 2003
    Location
    Michigan
    Posts
    1,941
    Here's how I would do it:

    In the forms OnCurrent event

    If ([6-6:30] = True) Then
    Me![6to630].Enabled = false
    Else
    Me![6to630].Enabled = True
    End if
    If ([6:30-7] = True) Then
    Me![630to7].Enabled = false
    Else
    Me![630to7].Enabled = True
    End if
    ...
    Inspiration Through Fermentation

  5. #5
    Join Date
    Aug 2003
    Posts
    5
    I typed in your suggested code just as you typed it in:

    Private Sub Form_Current()

    If ([6-6:30] = True) Then
    Me![6to630].Enabled = False
    Else
    Me![6to630].Enabled = True
    End If
    If ([6:30-7] = True) Then
    Me![630to7].Enabled = False
    Else
    Me![630to7].Enabled = True
    End If
    If ([7-7:30] = True) Then
    Me![7to730].Enabled = False
    Else
    Me![7to730].Enabled = True
    End If
    DoCmd.GoToRecord , , acNewRec

    End Sub

    It's not working for me. Can you modify the database and make what I want work and sent me the modified database?

  6. #6
    Join Date
    Jul 2003
    Location
    Michigan
    Posts
    1,941
    Sorry... I don't have time to do that today.

    I notice in the code that you reposted, however, that you didn't
    continue on with the code I started. You have to add an
    If... Then.. Else
    for each check box.

    You also don't want the Docmd.gotorecord,,AcNewRec in the OnCurrent
    event. That will get you stuck in an infinite loop...
    Every time you move to a record (new or not) the Oncurrent event fires,
    and you are telling it to move to a new record in the Oncurrent event
    Inspiration Through Fermentation

  7. #7
    Join Date
    Aug 2003
    Posts
    5

    Displaying all records on a form

    I only had those specific times in the last email b/c I wanted to save time. I dleleted the additional times off of the form and underlying table.

    Also when I hit the Add task button, I want the checked data information to go into the test table (one record at a time). For each time you hit the add task buttone for the specified times, I want this to be a new line in the table.

    Right now it's not doing that with the code you suggested. It does it with my code, but it doesn't display all data on the form. It only displays the first record's check boxes (as grayed out).

  8. #8
    Join Date
    Aug 2003
    Posts
    5

    Displaying all records on a form

    It is important to realize also that I don't want the entered data to be on the same record. I need it to be on different lines each time I hit the Add task button.

Posting Permissions

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