Question : Run-time error '2450'. Microsoft Access can't find form 'frmTenants'

I am trying to run an event procedure that will update a value in a field ('RoomID') within a form that has focus,  from a value in a field ('RoomID') within a loaded subform ('frmTenants'). When I attempt to reference this subform the following error appears:

Run-time error '2450'.
Microsoft Access can't find form 'frmTenants' referred to in a macro expression or Visual Basic code.

The event procedure code I am writing looks like this (from memory I don't have the application in front of me right now):

Me.RoomID = Forms!([frmTenants]![RoomID])

Please can you help!!!

250 Points for the right answer.

Answer : Run-time error '2450'. Microsoft Access can't find form 'frmTenants'

Make sure you use the name of the subform CONTROLS not the name of the form. Most of the time they are equal but not always.

The name of the control can be found as follows:

Open the form in design view -> Click the subform -> Properties -> Name (other tab)

this is the name you should use between the square brackets.
Random Solutions  
 
programming4us programming4us