Results 1 to 4 of 4
  1. #1
    eww is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Aug 2010
    Posts
    125

    Changing field in Report

    I have a report that has a re-submittal date field. It is from a form that has up to 5 re-submittal date entries and they way they work is one field is visible from the beginning. If a date is entered into that field, when the user comes back into the form a second re-submittal date field will appear (disabled) with a check box next to it. Checking the box will enable this date field and disable all others. This is set to work with up to 5 date fields.

    My problem is I want to show the most recent re-submittal date field, or the date checked, or the one enabled. They should all be the same thing. I've tried to put some code into the report but so far it is not working.

    Private Sub Report_Current()


    If Forms!sfrmSubDetStatus.txtResubmittalDate1.Enabled = True Then
    Me.ResubmittalDate1.Value = Forms!txtResubmittalDate1.Value
    ElseIf Forms!sfrmSubDetStatus.txtResubmittalDate2.Enabled = True Then
    Me.ResubmittalDate1.Value = Forms!txtResubmittalDate2.Value
    ElseIf Forms!sfrmSubDetStatus.txtResubmittalDate3.Enabled = True Then
    Me.ResubmittalDate1.Value = Forms!txtResubmittalDate3.Value
    ElseIf Forms!sfrmSubDetStatustxtResubmittalDate4.Enabled = True Then
    Me.ResubmittalDate1.Value = Forms!txtResubmittalDate4.Value
    ElseIf Forms!sfrmSubDetStatus.txtResubmittalDate5.Enabled = True Then
    Me.ResubmittalDate1.Value = Forms!txtResubmittalDate5.Value
    End If
    End Sub

    I'm guessing there's a way to do this, and I'm probably just not doing something right.

  2. #2
    NTC is offline VIP
    Windows Vista Access 2007
    Join Date
    Nov 2009
    Posts
    2,392
    well you seem to have one foot in forms and one foot in reports. The report control(s) I will presume is bound to its record source. So if you are attempting to manipulate a report value then you generally want to do so at its record source.

    If the correct values are in the record source - then you do not need to reference any form; you can manipulate visibility of controls displayed in the Report during the section's property 'OnFormat' event with code and toggle visibility on/off.

    More than one way to skin a cat but this is what I would suggest.

  3. #3
    eww is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Aug 2010
    Posts
    125
    Yeah I agree with you. Thought about just making the fields visible or not based on what the values or properties were, but then I was confused about what to do with the layout, as I'd want them to always be in the same column.

    Would I have to overlap these controls? I have them in a tabular layout so I was pretty sure I couldn't keep that while putting the others on top, since it auto formats the layout when you pull them in. I guess I'll just have to remove the layout and stack them on each other and set the visibilities to change accordingly unless you might know of a better way. For the layout at least.

  4. #4
    eww is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Aug 2010
    Posts
    125
    On your advice I realized what I needed to do. Basically what I was trying to do in the report I just needed to do in the form. I set up an invisible ResubmittalDate field that depending on which of those resubmittals was enabled it would take the value and then that field is the one that shows up on the actual report.

    Thanks for the help.

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

Similar Threads

  1. Changing Field Values with Command Button
    By avarusbrightfyre in forum Access
    Replies: 1
    Last Post: 08-22-2010, 12:48 PM
  2. Changing value of a field after an event.
    By mikethebass in forum Access
    Replies: 1
    Last Post: 06-16-2010, 04:42 PM
  3. Changing field names in queries
    By scottsoo9 in forum Queries
    Replies: 1
    Last Post: 12-01-2009, 05:47 PM
  4. changing a records field value
    By tubar in forum Queries
    Replies: 3
    Last Post: 07-06-2009, 07:36 AM
  5. Replies: 0
    Last Post: 03-16-2006, 04:59 AM

Tags for this Thread

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