Run time Error 2164 help! (1 Viewer)

MMOST

New member
Local time
Today, 01:09
Joined
Jun 4, 2008
Messages
3
Hi there,

I have designed an Acess database that is currently active with a lot of help from an expert - I am completely new at this so bear with me if this seems so simple!

I have a form with 2 subforms. the fields in the form itself are unbound. I was in design view, right-clicked on the form ("grey area") and chose tabbing in order to better arrange the tab function. It tabs just fine, however when in another form that is coded to open this main form (when data is entered into the second sub form), the Run time Error 2164 "You can't disable the control while it has the focus" comes up. All I did was change the tabbing and I don't have a clue what the error message means! I don't even know what the code itself means (embarassing but true!) My expert is out of town. Here is the code it brings me to:

On Error Resume Next
DoCmd.OpenForm "New MTN", acNormal, , , , , "fromItemSearch"
Forms![new mtn].Form![Shipped From] = Location
Forms![new mtn].Form![Shipped From].Locked = True
Forms![new mtn].Form![Shipped From].Enabled = False
Resume


I would really appreciate any help I can get as soon as possible! Thank you!
 

RuralGuy

AWF VIP
Local time
Today, 03:09
Joined
Jul 2, 2005
Messages
13,826
The syntax you are using to access the freshly opened form is not correct among other things. Here's a link to examples of the correct syntax:
Refer to Form and Subform properties and controls
As for the error, what is the name of the first control in your tabbing list on that form? Could it be the [Shipped From] control?
 

MMOST

New member
Local time
Today, 01:09
Joined
Jun 4, 2008
Messages
3
Run time error 2164

Hi there - thank you for your response! as you can tell, I am not schooled in Access at all so I apologize for using nontechnical terms...

yes it is the first control in the form (there is another before it which is an automatically generated number so it can be ommitted for this purpose).
 

RuralGuy

AWF VIP
Local time
Today, 03:09
Joined
Jul 2, 2005
Messages
13,826
Move this control to a different tab spot to see if the problem goes away.
 

Users who are viewing this thread

Top Bottom