Skip to content
Advertisement

Creating data entry form using button VBA

I am trying to create a basic data entry form, however, it is turning into more trouble than I anticipated.. I have the form created, now I am just trying to INSERT the data into the DB (TEST). I am receiving an “Object Required” error. Any suggestions? All of the txt boxes are verified to be correct. This is all being done through Access VBA

Advertisement

Answer

From what I can see there’s a couple of mistakes in the code.

You only use SET when setting a reference to an object – sSQL is a text string.
DoCmd.RunSQL shouldn’t have a full-stop after RunSQL– just the text string.
If Me.txtENTNAME is a text string it should have an apostrophe before and after it.

Advertisement