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.
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.
I think the WB was corrupted some how.
The "Data" sheet was there, but not registered
Capture.JPG
Try this corrected version
---------------------------------------------------------------------------------------------------------------------
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
Thanks Paul, but I still get an error. Please can you help me?
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)
There might be morePrivate 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
---------------------------------------------------------------------------------------------------------------------
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
Thanks Paul, but I still can not execute the program. Can you help me please?
---------------------------------------------------------------------------------------------------------------------
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
There is sort of VBA error . Thanks
---------------------------------------------------------------------------------------------------------------------
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