Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Error 2115 -- what the heck?

Status
Not open for further replies.

mesavage

Programmer
Jan 24, 2002
21
0
0
US
Hi all!

I am trying to use an option box to fill some boxes below. My problem is that whenever I click on any of the radio buttons, I get the following error:

Run-time error '2115':
The macro or function set to the BeforeUpdate or ValidationRule property for this field is preventing Microsoft Access from saving the data in the field.

The code that is complaining is the following:
combo_host1name.SetFocus
combo_host1name.Text = h1name <-- ERROR HERE

If I use a button to run the function that sets this stuff, it is fine. If I even call the &quot;afterupdate&quot; function for the option controls, it is fine. I've tried all kinds of things, and the only time I have a problem is when I actually CLICK the radio buttons.

If someone can help me, I would appreciate it! Although I can use buttons instead, the radio buttons just look a little nicer! Thanks!

Miriam
 
When you use the option button, h1name is probably not getting filled with a value. The table field is probably set to not allow nulls. Check your logic on how the option button fills the value for h1name. You could add a debug.print statement in the beforeupdate event of the option button to check the value.
 
No, I have debug prints before to print out the value, and make sure that h1name is set properly...and it is. Any other ideas?

Miriam
 
Oh, I forgot to mention I did the debug.print right before the assignment. I don't have a beforeupdate event, which is the crazy part! This is suppose to be in the &quot;afterupdate&quot; event!
 
The option frame has focus events as well as each option does, but you probably don't need them in your example unless you want to fire the code under each option. If you have a button you can do something like this.

'-- on button click
Dim optFrame As Integer
optFrame = optionFrameView ' Name of option frame
QUOTE = Chr$(34)

Select Case optFrame ' Evaluate Number.
Case 1 ' Shop Orders for a Customer
DocName = &quot;GQSShopOrders&quot;
Case 2 ' Equipment Type - Motors of a particular type or HP
DocName = &quot;GQSNameplateForm&quot;
Case 3 ' Cause of Failure across all Equipment
DocName = &quot;GQSEquipmentFailureForm&quot;
ETC......

This is checking the options under a button in an example from a program I wrote.

Options are numbered 1,2,3,.........
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top