Results 1 to 2 of 2
  1. #1
    Join Date
    May 2002

    Unanswered: Adding text to a form

    I want to add text to a form

    eg when I open a form I would like a dialog box to ask me to enter say a
    When the form opens this date would be typed at the top of the form.

    I think I will need an unbound text box but cant seem to work out how to
    make it work.

    Can anyone help me?

    Best Regards

    Matt and Karen Day

  2. #2
    Join Date
    May 2002
    Atlanta, GA
    You could try the following:

    On the "On Load" Event of your form place the following code.

    Private Sub Form_Load()
    Dim TextString as String
    TextString = InputBox ("Please enter a valid Date.", "Enter Data")
    Me.SomeField = TextString
    End Sub

    If you want to make sure the Input Box actually has data you can do this:

    Dim TextString As String
    TextString = InputBox("Please enter a valid Date.", "Enter Data")
    If TextString = "" Then
    MsgBox "Please Enter Valid Data.", vbExclamation
    Call Form_Load
    Me.SomeField= TextString
    End If

    You can manipulate this code to suite your needs, but this should get you started.

    Good Luck!!!!


Posting Permissions

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