Run-time Error While Moving Field In Tabbed Forms (1 Viewer)

JGravesNBS

Registered User.
Local time
Today, 11:51
Joined
Apr 5, 2014
Messages
58
Run-time Error While Moving Field In Tabbed Forms

I have a tabbed form Name: TabCtl0

I'm trying to move the value of Me.strOwnerName in the Permit Information tab
to Me.strApplicant in the Applicant/Contractor tab

Name: Permit Information Page Index: 0
Me.strOwnerName

Name: Applicant/Contractor Page Index: 2
Me.strApplicant

On the Permit Information tab, I have the following code:

Me.strApplicant = Me.strOwnerName (This works fine in Access 2000 & 2007)

When I run Me.strApplicant = Me.strOwnerName on Access 2013 & 2016 I get the following error message:

Microsoft Visual Basic
Run-time error +2147352567 (80020009)
The data has been changed.
Continue End Debug

with Me.strApplicant = Me.strOwnerName highlighted

Any thoughts?

11397335
 

Ranman256

Well-known member
Local time
Today, 14:51
Joined
Apr 9, 2015
Messages
4,337
usu different tabs have different subforms , then it would be:
forms!fMain!subFrm2.form.strApplicant = forms!fMain!subFrm1.form.strOwnerName

but if you only have 1 subform and swap out the source tbl , then youd need to save to a variable then replace after the tab change.
 

JGravesNBS

Registered User.
Local time
Today, 11:51
Joined
Apr 5, 2014
Messages
58
usu different tabs have different subforms , then it would be:
forms!fMain!subFrm2.form.strApplicant = forms!fMain!subFrm1.form.strOwnerName

but if you only have 1 subform and swap out the source tbl , then youd need to save to a variable then replace after the tab change.

Thanks for your help and for pointing me in the right direction, I haven't looked at this code for 20 years

Looks like earlier versions of Access were more forgiving

After further review, the field was locked, so I had to add the code to unlock, do the move, and lock

FormState ("Unlocked") 'Unlocked Me.strApplicant.Locked = False

Me.strApplicant = Me.strOwnerName

FormState ("Locked") ' Locked Me.Me.strApplicant.Locked = True
 

Users who are viewing this thread

Top Bottom