Consulting

Results 1 to 8 of 8

Thread: Creating a database using a VBA code with user from

  1. #1
    VBAX Regular
    Joined
    Jul 2015
    Posts
    66
    Location

    Creating a database using a VBA code with user from

    Hi everybody,

    I want to create a database using VBA code with user form. Can anyone help me please? I am attaching a VBA, but I get an error with this file when i execute it. Thanks in advance.
    Attached Files Attached Files

  2. #2
    VBAX Sage
    Joined
    Apr 2007
    Location
    United States
    Posts
    8,726
    Location
    I think the WB was corrupted some how.

    The "Data" sheet was there, but not registered

    Capture.JPG

    Try this corrected version
    Attached Files Attached Files
    ---------------------------------------------------------------------------------------------------------------------

    Paul


    Remember: Tell us WHAT you want to do, not HOW you think you want to do it

    1. Use [CODE] ....[/CODE ] Tags for readability
    [CODE]PasteYourCodeHere[/CODE ] -- (or paste your code, select it, click [#] button)
    2. Upload an example
    Go Advanced / Attachments - Manage Attachments / Add Files / Select Files / Select the file(s) / Upload Files / Done
    3. Mark the thread as [Solved] when you have an answer
    Thread Tools (on the top right corner, above the first message)
    4. Read the Forum FAQ, especially the part about cross-posting in other forums
    http://www.vbaexpress.com/forum/faq...._new_faq_item3

  3. #3
    VBAX Regular
    Joined
    Jul 2015
    Posts
    66
    Location
    Thanks Paul, but I still get an error. Please can you help me?

  4. #4
    VBAX Sage
    Joined
    Apr 2007
    Location
    United States
    Posts
    8,726
    Location
    Capture.JPG


    I can call the macro from the button and since 'Data' sheet is there it goes farther

    Stepping through and looking at the line that fails, the text box is named 'txtEmplName' and not 'txtEmpName' (missing the L)

    Private Sub cmdNew_Click()
    blnNew = True
        txtEmpNo.Text = ""
        txtEmplName.Text = ""   '<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
        txtAdd1.Text = ""
        txtAdd2.Text = ""
        txtAdd3.Text = ""
        txtTel.Text = ""
        txtDesignation.Text = ""
        cmdClose.Caption = "Cancel"
        cmdNew.Enabled = False
        cmdDelete.Enabled = False
    End Sub
    There might be more
    ---------------------------------------------------------------------------------------------------------------------

    Paul


    Remember: Tell us WHAT you want to do, not HOW you think you want to do it

    1. Use [CODE] ....[/CODE ] Tags for readability
    [CODE]PasteYourCodeHere[/CODE ] -- (or paste your code, select it, click [#] button)
    2. Upload an example
    Go Advanced / Attachments - Manage Attachments / Add Files / Select Files / Select the file(s) / Upload Files / Done
    3. Mark the thread as [Solved] when you have an answer
    Thread Tools (on the top right corner, above the first message)
    4. Read the Forum FAQ, especially the part about cross-posting in other forums
    http://www.vbaexpress.com/forum/faq...._new_faq_item3

  5. #5
    VBAX Regular
    Joined
    Jul 2015
    Posts
    66
    Location
    Thanks Paul, but I still can not execute the program. Can you help me please?

  6. #6
    VBAX Sage
    Joined
    Apr 2007
    Location
    United States
    Posts
    8,726
    Location
    Quote Originally Posted by alihadi View Post
    Thanks Paul, but I still can not execute the program. Can you help me please?

    I can execute it without any debug errors

    Do you mean that it doesn't do what you want it to, or there is some sort of VBA or Excel error?
    ---------------------------------------------------------------------------------------------------------------------

    Paul


    Remember: Tell us WHAT you want to do, not HOW you think you want to do it

    1. Use [CODE] ....[/CODE ] Tags for readability
    [CODE]PasteYourCodeHere[/CODE ] -- (or paste your code, select it, click [#] button)
    2. Upload an example
    Go Advanced / Attachments - Manage Attachments / Add Files / Select Files / Select the file(s) / Upload Files / Done
    3. Mark the thread as [Solved] when you have an answer
    Thread Tools (on the top right corner, above the first message)
    4. Read the Forum FAQ, especially the part about cross-posting in other forums
    http://www.vbaexpress.com/forum/faq...._new_faq_item3

  7. #7
    VBAX Regular
    Joined
    Jul 2015
    Posts
    66
    Location
    There is sort of VBA error . Thanks

  8. #8
    VBAX Sage
    Joined
    Apr 2007
    Location
    United States
    Posts
    8,726
    Location
    Quote Originally Posted by alihadi View Post
    There is sort of VBA error . Thanks
    There are many, many, many errors that VBA will report

    Which one? On what line? What are you doing when the error occurs?
    ---------------------------------------------------------------------------------------------------------------------

    Paul


    Remember: Tell us WHAT you want to do, not HOW you think you want to do it

    1. Use [CODE] ....[/CODE ] Tags for readability
    [CODE]PasteYourCodeHere[/CODE ] -- (or paste your code, select it, click [#] button)
    2. Upload an example
    Go Advanced / Attachments - Manage Attachments / Add Files / Select Files / Select the file(s) / Upload Files / Done
    3. Mark the thread as [Solved] when you have an answer
    Thread Tools (on the top right corner, above the first message)
    4. Read the Forum FAQ, especially the part about cross-posting in other forums
    http://www.vbaexpress.com/forum/faq...._new_faq_item3

Posting Permissions

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