+ Reply to Thread
Results 1 to 3 of 3

Looping Problem??

Hybrid View

  1. #1
    Registered User
    Join Date
    02-08-2005
    Posts
    2

    Question Looping Problem??

    I am new to Excel VBA programming and have a User Form pretty much working the way I want it to except for the following problem which I think requires some sort of loop.
    My form has 3 different text boxes, Catalog A, Catalog B, and Catalog C. If all three remain without a value when the "Enter Info. " button is pressed to add all information to my database I would like a message box to appear saying "Enter any Catalog No." and no data being entered into the spreadsheet.
    Also, if any of the 3 catalogs have had a value entered then I would like all the information entered into the spreadsheet when the "Enter Info." button is pressed.
    Any suggestions would be greatly appreciated.

    Thanks, Erik

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259
    HEllo Eric,

    It it simple enough to do. Add the following code to your "Enter Info" button on the form.

    If TextBox1.Text = "" And TextBox2.Text = "" And TextBox3.Text = "" Then
    MsgBox "Enter Catalog Number"
    Exit Sub
    End If

    Hope this helps,
    Leith Ross

  3. #3
    Registered User
    Join Date
    02-08-2005
    Posts
    2
    Thanks, Leith. My form now works the way I want it to. It was a lot more simple than I was making it out to be.

    Regards,
    Erik Thureson

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1