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 Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Trouble With Access Form Controls

Status
Not open for further replies.
Joined
Apr 29, 2005
Messages
6
Location
GB
Morning everybody,

I have a database that is used by a call centre to mark the quality of calls taken by phone staff and score the calls appropriately.

The form uses radio buttons to select whether the CSA got a YorN for each requirement. If a button is checked then the after update event populates a text box with the relevent development area.

I recently had to add some extra questions to one of the forms so copied a block of the existing controls (buttons, and text boxes), pasted them and re-named as necessary.

However I now find that although i have used exactly the same code and properties as for previous buttons i have 8 development area boxes (there are 64 on the form) that auto-populate with a #name error when the form is opened and then when i try to tick one of the new buttons i get the 2448 run time error saying i cant assign values to this control. I have had 3 other analyst look at this and we are all pretty convinced my code is right (as it works 300+ time elsewhere on the database) but even so no one can see why it wouldnt work.

Below is the code that i have used for the afterupdate event on all my buttons (the only thing that changes is the name):

This one works
Private Sub TechN34_AfterUpdate()
Me!MSalesDev55 = Null
If (Me![TechN34] = -1) Then
Me!MSalesDev55 = " 55.Documents"
End If
End Sub

This one doesnt
Private Sub TechN35_AfterUpdate()
Me!MSalesDev57 = Null
If (Me![TechN35] = -1) Then
Me!MSalesDev57 = " 57.Proof Of NCD"
End If
End Sub

So i throw this out to the world hoping someone can help me out a bit here.

Many thanks in advance for any time/thought taken with this problem.

Regards

Chris
 
I saw once that copying controls which have code on a form may not work, though all seems perfect. (I can't think how to track down that thread; I believe it was on Tek-Tips.) There's some bug where Access fails to relate the control with the VBA.

Take one of your new, nonfunct controls and rebuild it as if from scratch, using the Event tab of the control properties to enter the VBA. If it works, I think you have encountered an obscure Access bug.

[purple]_______________________________
Never confuse movement with action -- E. Hemingway [/purple]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top