PDA

View Full Version : Creating a database using a VBA code with user from



alihadi
09-28-2016, 04:21 PM
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.

Paul_Hossler
09-28-2016, 05:01 PM
I think the WB was corrupted some how.

The "Data" sheet was there, but not registered

17212

Try this corrected version

alihadi
09-29-2016, 06:42 AM
Thanks Paul, but I still get an error. Please can you help me?

Paul_Hossler
09-29-2016, 06:57 AM
17217


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

alihadi
09-29-2016, 02:25 PM
Thanks Paul, but I still can not execute the program. Can you help me please?

Paul_Hossler
09-30-2016, 05:41 AM
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?

alihadi
09-30-2016, 07:50 AM
There is sort of VBA error . Thanks

Paul_Hossler
09-30-2016, 09:57 AM
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?