Access 2016 – Command Button Wizard will not appear

microsoft accessmicrosoft-office-2016

I am on windows 10 with office 2016. I am following along with this tutorial and running into an issue.

The text describes the third step of the method as placing the button from Form Layout View (step 1). There is no form layout view, there are form view and layout view. form view has no design tab, so we can't place a button. That leads me to think "it must be layout view".

When you place the button, step 4 says the Command Button Wizard will appear. It does not appear. Looking at the dropdown for the options for the controls on the right, I see Use Control Wizards is selected (it is darkened). The button places just fine, but no dialog appears.

This led me to believe that maybe a different view is appropriate. There are only 3 views listed and I've already explored 2. So I looked at Design View next. It also shows the use control wizards option as selected, but placing the button does not produce the wizard.

I went on to read about how to set up a button without the wizard. It says that you can change the values of the properties: https://support.office.com/en-us/article/Use-a-command-button-to-start-an-action-or-a-series-of-actions-c7bf2827-2f3e-42b8-83d6-6c4f0de78990#bmfromscratch (see step 7)

However, in my experience, the properties are listed (on the right), but not their values. double clicking or otherwise trying to set a value for a field, for example Name, does not work. Is there a some setup we need to do with a database before these things work properly?

edit – I found a part of my problem, the property sheet on the right was too narrow to show the values. dragging it out I see the key-value pairs for each property of the object I am inspecting on the form. I still don't know how to use this to set up a new record, but, at least I am getting somewhere.

Finally, I started to build event, hoping I could do it that way. That brings up VisualBasic. The left panel there has properties for the button, both the property keys and their values. It is editable (!!).

This is where I get confused. What should I do to make a new record? I don't see how to do this using properties, I'm not sure how the wizard works for this action.

If I write the VB code like:

Option Compare Database
Private Sub New_Record_Click()
    DoCmd.RunSQL "INSERT INTO [Order items] ([Order ID], [Menu Item ID], [Quantity ID]) VALUES (Me.Text43.Value, Me.Combo16.Value, Me.Quantity.Value)"
End Sub

It appears to do nothing when I click that button in form view: I don't see the a new record when I change some fields and do this.

edit: I found that somehow I had New_Record_Click, probably from an earlier attempt at the button, and that was the reason. from there I was able to debug the script. It still prompts that you are about the add a row, though (probably a good thing really). This produces a solution but does not debug the wizard. I could still use help. Here's the working code:

Private Sub NewRecord_Click()

    DoCmd.RunSQL "INSERT INTO [Order items] ([Order ID], [Menu Item ID], [Quantity]) VALUES (" & Me.Text43.Value & ", " & Me.Combo16.Value & ", " & Me.Quantity.Value & ")"

End Sub

Best Answer

The problem might be that you're trying to add a control on a subform (while inside the main form) using the Control Wizard. That does not work.

Instead you should open the subform in another window and add the control there. That way the Control Wizard will pop up.

Cheers

Related Question