1. Home
  2. Docs
  3. Getting Started
  4. Add or change fields on existing Virtual Form

Add or change fields on existing Virtual Form

In a real world scenario, our worksheets are constantly changing.

In this article, I will show you what to do when you add new fields to existing worksheets and what to do when you change the name of a column that is already on a Virtual form.

 

 

 

Add new fields to existing Virtual Form

When you add a new column to your worksheet follow this steps to include these columns to an existing Virtual Form.

Let’s say that we have Test1 worksheet in our workbook that contains the data.

 

Now we have added 1 new column “Test count”. Also, we have entered the data for the first row, so that the database engine can recognize the field type (numeric).

 

 

Save the workbook.

 

Open the Virtual Form by going to the “Menu” worksheet and clicking the button “Open Main Menu”, then on the userform “Main Menu” click the button  “Open the Virtual Form VF2”.

When the Virtual Form opens, on the right side below the last button click the right mouse button. Menu will open with menu item “Open Virtual Form in VF Designer”. Click on it.

 

 

This will open the Virtual Form Designer, and the Virtual Form that we are editing will be preselected.

 

Right mouse click on the Grid control and select “Add Grid Columns”.

 

 

Virtual Form Designer will scan the associated worksheet and display only the columns that are not already on the Virtual Form.

 

Click “Process” and the selected column(s) will be added.

The same steps we need to do to add the column(s) to the Edit control. Right mouse click on the Edit control of our virtual form in the treeview.

 

Process the fields that you want to add to the Edit control and your Virtual Form is ready.

Now you can close the Virtual Forms Designer and then reopen the Virtual Form in Excel.

 

Change the name of a column on existing Virtual Form

When you change the name of a column in your worksheet that you already included on an existing Virtual Form follow this steps to change it in your Virtual Form.

Let’s say that we have Test1 worksheet in our workbook that contains the data.

 

 

Now we have changed the column “Test Cost” to “Test Price”.

 

 

If we follow the standard scenario of adding new fields to our Virtual Form, we will get the new field, but also we will be left with the old field that doesn’t exist anymore on our worksheet.

So the better approach is to change the field.

 

2.1 Step

On the “Main Menu” click the “Open Virtual Forms Designer”

 

2.2 Step

In the Virtual Form Designer Treeview on the left side, find the Form and click on the + sign to expand the node.

 

Now expand the Grid control and find the field “Test Cost” and click on it to open the Properties window for it.

 

On the right side in the “Field Name” select the new field and also change the “Caption”.

 

Click save. Now find the field in the Edit control, click on it and on the right side change the “Field Name” and “Caption”.

 

 

 

Save the changes made and we are done.

 

Important Note:

If the field is also the ID Field, then you need to change the field name in the Form properties, Grid control and Edit control properties.

Was this article helpful to you? Yes No

How can we help?