Transferring Userform Textbox Values to Access

SINGERT

New Member
Joined
Jun 25, 2015
Messages
11
Hello!
I'm relatively new to Access and have limited VBA programming skills. I have created a userform that lets people enter the different gauging values from various points on a part. There are also "click" buttons that they use to show if something "passed" or "failed" When I submit the userform, the "pass/fail" information transfers over just fine, but the numerical data entered into the Textboxes transfers as 0. I'm not sure what I'm doing wrong? Any thoughts?
 
Your methods are very unorthadox. Did you worry about declaring the public variables as Static or By Ref? If you set the value of a variable in such a way, it holds the value until something else changes or destroys it. Subsequent reference to it can return unexpected results that you may or may not notice. Also, this
Gearcase.Spec2_TextBox.Value
is not the way to refer to a form and any of its controls. Nor should you be using text if you want a number and then using the Val function to extract numerics from it. A minor point is that the default property of a textbox is .Value, so you don't need to refer to it. More importantly, Val(Gearcase.Spec2_TextBox.Value) will return 0 if it cannot find text that resembles a number, which is probably your major problem.
 
Upvote 0

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off

Forum statistics

Threads
1,221,851
Messages
6,162,429
Members
451,765
Latest member
craigvan888

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