Simple VBA question-> syntax

fmcampos

New Member
Joined
Jan 6, 2004
Messages
16
I think this is a fairly simple problem. I have to make a reference in a procedure to a form that has "spaces" on it´s name. I have done this in the past when referencing to a field just by changing the spaces to "_". But that doesn´t seem to work when referencing to a form. I know i should have created everything without spaces, but it´s gonna be such a hassle to change everything back now...!

ex:
the form name is [bla bla bla]

form.bla bla bla.value --> doesn´t work
form.bla_bla_bla.value --> doesn´t either

tkx

fmc
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
If you're referencing the form from a Form Module, then you can use the 'Me' Keyword in place of the actual name. If you're referencing the form from a Standard Module, then the reference should be:
Code:
Forms![bla bla bla].Value
Note that there is actually no 'Value' property of a form, so unless you're just using the word 'value' to mean some generic form Property, Method, or Event, you're still going to get an error.
 
Upvote 0

Forum statistics

Threads
1,221,604
Messages
6,160,748
Members
451,670
Latest member
Peaches000

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top