Consulting

Results 1 to 3 of 3

Thread: Solved: Load AND unload?

  1. #1
    VBAX Regular
    Joined
    Aug 2005
    Posts
    56
    Location

    Solved: Load AND unload?

    Hey,

    I have userform, in one text box you when your entering new product information is a barcode slot, while punching in the barcode (or when your down with it) the box searches database to find any copies, so you know immediately when entering the barcode whether the product already exists or another one has the same barcode.

    What i want to happen is when it finds a matching barcode, a button appears to give you the option to EDIT the copy it found, for the editing there is another userform. Problem is if i do Load EditingForm and Show from this button it will load the other form, cool, but if BOTH of these forms are open it causes problems.

    So how can i Unload the NewProductForm and simaultanously (SP?) open the EditingForm?

    I tried to have a "midway" userform where when you click on the Edit button that appears from the newproduct form it would open up an empty userform and on that empty one the "_activate()" part would unload the NewProduct and Load the EditingForm, but i get an error saying simply it CANT unload the NewProduct form...

    Any Idea?
    Thanks.

  2. #2
    VBAX Mentor asingh's Avatar
    Joined
    Jul 2005
    Posts
    307
    Location
    Hi,

    You could try the following...

    [VBA] Private Sub Click_Show_EditForm ()
    'this is the button where the new form is to be launched from

    NewProductForm.Hide
    Unload NewProductForm
    Set NewProductForm = Nothing

    Load EditForm
    EditForm.Show


    End Sub
    [/VBA]
    what this will do....completely KILL the instance of the NewProductForm and display the editform. If you dont want the instance to be KILLED then dont use Unload & Set NewProduct = Nothing. If you want the NewProductForm to be displayed again..then another command button will be required..to unload the edit form..and display the new product form again.




    end sub
    Last edited by malik641; 01-20-2006 at 09:29 AM. Reason: Needed some VBA Tags

  3. #3
    VBAX Regular
    Joined
    Aug 2005
    Posts
    56
    Location
    perfect, thanks alot!

Posting Permissions

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