Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2003
    Posts
    6

    Angry Unanswered: Conditional prompts on report

    Hi all.

    Have got a field in a table which may or not be blank. I want this field to appear on a report and if it is blank at point of printing them prompt for a value, if the field already has data don't prompt.

    Can do it in code on the format page event but was wondering whether a far simpler way I have not thought about. Tried prompt within a iif(isnull)) expression on query but seems to prompt everytime regardless.

    Cheers for looking...

    Andrew C

  2. #2
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713

    Re: Conditional prompts on report

    Originally posted by archetham
    Hi all.

    Have got a field in a table which may or not be blank. I want this field to appear on a report and if it is blank at point of printing them prompt for a value, if the field already has data don't prompt.

    Can do it in code on the format page event but was wondering whether a far simpler way I have not thought about. Tried prompt within a iif(isnull)) expression on query but seems to prompt everytime regardless.

    Cheers for looking...

    Andrew C
    Ok ... Assuming that you prompt the user, what action needs to take place? What are you prompting the user for? Fill in the blank? If so, NO GO. You can't populate textboxes on a report thru code ...

  3. #3
    Join Date
    Jan 2003
    Posts
    6
    This is the code I was playing around with and it seems to work.

    Got a field in the table called Data2, I have placed this and an unbound field called Data3 on the report and run this code on the group footer format event.


    Private Sub GroupFooter0_Format(Cancel As Integer, FormatCount As Integer)
    If IsNumeric(Me.Data2.Value) Then
    Data3.Value = Me.Data2.Value
    Else
    Dim response
    response = InputBox("Prompt: ")
    Data3.Value = response
    End If
    End Sub

    Just wondered any easier way.

Posting Permissions

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