Results 1 to 5 of 5

Thread: Declaration Expected!!!!!!!!!!!!

  1. #1

    Thread Starter
    Member
    Join Date
    Feb 2007
    Posts
    39

    Declaration Expected!!!!!!!!!!!!

    I'm not a very good programmer. Just throwing that out there, but i've also only been trying it for like 2 weeks. I use VB express 2005 and im just fiddling around with some functions. So far i can type words click a button and they are displayed in the rich text box. EXCITING

    Code:
    Public Class Form1
    
    
        Private Sub Displaytextbutton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Displaytextbutton.Click
            DisplayBox.Text = DisplayBox.Text + Textinputbox.Text
                End Sub
    
    End Class

    Now what i'm trying to do is use a module to detect any functional inputs
    such as

    Clear Screen
    Delete Last input

    etc...

    right now all i want is for my main form to call the module (_erase) and by calling it the rich textbox gets cleared. In my form i want to set up the functions.

    EX.
    If textinputbox.text = ("delete")
    then
    erase()

    something along that line. I can't test it because when im writing the code it says declaration expected under displaybox no matter what i do.

    Code:
    Module _erase
        Displaybox.text = ("")
    End Module
    Basically...how do i declare display box

    -Blackout

  2. #2
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    Re: Declaration Expected!!!!!!!!!!!!

    You can't call a module... a module is a collection of subs and functions....

    Code:
    Module MyStuff
      Public Sub erase
        Displaybox.text = ("")
      End Sub
    End Module
    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  3. #3
    Hyperactive Member
    Join Date
    Apr 2005
    Location
    Indiana
    Posts
    451

    Re: Declaration Expected!!!!!!!!!!!!

    Use YourFormName.Displaybox.text

    and you should use YourFormName.Displaybox.text = system.string.empty.

    Hope that helps.

  4. #4
    Hyperactive Member
    Join Date
    Apr 2005
    Location
    Indiana
    Posts
    451

    Re: Declaration Expected!!!!!!!!!!!!

    I misunderstood your question.

    Techgnome is right. Sorry.

  5. #5

    Thread Starter
    Member
    Join Date
    Feb 2007
    Posts
    39

    Re: Declaration Expected!!!!!!!!!!!!

    Thank You

    i think i can get it working now

    -blackout

Posting Permissions

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



Click Here to Expand Forum to Full Width