Runtime Error 2424 (1 Viewer)

KACJR

Registered User.
Local time
Today, 14:10
Joined
Jul 26, 2012
Messages
81
Greetings to the well of knowledge...


I've read a few posts about this particular error occurring ad now it is with my particular project.


Let me preface this by saying that I just recently switched over to using Access 2016. When doing this sort of simple programming under Access 2010, I have never ever encountered this error in any form.


So here is my code. Nothing that I haven't written millions of times before without issue.
Private Sub ShowFormInfo()
' Show provider information if the Provider radio button was selected.
Me.ProviderInfoHeader.Visible = False
Me.ProviderContactName.Visible = False
Me.ProviderPosition.Visible = False
Me.ProviderAgency.Visible = False
Me.ProviderEmail.Visible = False
Me.ProviderPhoneNumber.Visible = False
Me.ProviderFaxNumber.Visible = False
If Me.ParentOrProvider = "Provider" Then
Me.ProviderInfoHeader.Visible = True
Me.ProviderContactName.Visible = True
Me.ProviderPosition.Visible = True
Me.ProviderAgency.Visible = True
Me.ProviderEmail.Visible = True
Me.ProviderPhoneNumber.Visible = True
Me.ProviderFaxNumber.Visible = True
End If
End Sub


The form throws runtime error 242 at the If statement. The field, Me.ParentOrProvider, is in the recordset which is a basic SELECT query. I initially tried to execute this with the field not visible (desired) but tried running it with the field visible, but no love.


This is really frustrating and I'd appreciate another set of eyes on this.


Regards,
Ken :banghead:
 

theDBguy

I’m here to help
Staff member
Local time
Today, 11:10
Joined
Oct 29, 2018
Messages
21,454
Hi Ken. What is the error description or message for runtime error 2424?
 

June7

AWF VIP
Local time
Today, 10:10
Joined
Mar 9, 2014
Messages
5,466
By 'field visible' you mean a control - textbox, combobox, etc. ?

Why have this data conditionally display? Why not just always display? Why should user have to make this choice?
 

KACJR

Registered User.
Local time
Today, 14:10
Joined
Jul 26, 2012
Messages
81
I should also add that all of the other "Provider..." fields display as #Name? in the form.
 

theDBguy

I’m here to help
Staff member
Local time
Today, 11:10
Joined
Oct 29, 2018
Messages
21,454
I should also add that all of the other "Provider..." fields display as #Name? in the form.
Are you able to post a sample copy of your db with test data?
 

KACJR

Registered User.
Local time
Today, 14:10
Joined
Jul 26, 2012
Messages
81
By 'field visible' you mean a control - textbox, combobox, etc. ?

Yes, all text boxes.



Why have this data conditionally display? Why not just always display? Why should user have to make this choice?


The data is provided from an external web form source and fills the form so that it can be viewed (not edited). The "user" chooses" this from the web form and the data is written to the table from the web form. Basically, the form asks if the application is being filled out by a parent or a service provider. If it is a service provider then it asks for additional info about the service provider. This data would be visible in the Access form only if service provider was checked..
 

KACJR

Registered User.
Local time
Today, 14:10
Joined
Jul 26, 2012
Messages
81
Hi Ken. What is the error description or message for runtime error 2424?


"The expression you entered has a field, control, or property name the <application> can't find."
 

KACJR

Registered User.
Local time
Today, 14:10
Joined
Jul 26, 2012
Messages
81
Are you able to post a sample copy of your db with test data?


Unfortunately, I can't. It's all linked tables from an SQL Server DB. The Access piece is just a front end.
 

KACJR

Registered User.
Local time
Today, 14:10
Joined
Jul 26, 2012
Messages
81
I must also mention that these "Provider..." fields were just added to the DB using Access 2016. If I do this using Access 2010, no errors.
 

theDBguy

I’m here to help
Staff member
Local time
Today, 11:10
Joined
Oct 29, 2018
Messages
21,454
Unfortunately, I can't. It's all linked tables from an SQL Server DB. The Access piece is just a front end.
How about images then? If you're getting a "can't find error" at Me.ParentOrProvider, what happens if you use a bang operator? For example:
Code:
Me!ParentOrProvider
 

KACJR

Registered User.
Local time
Today, 14:10
Joined
Jul 26, 2012
Messages
81
How about images then? If you're getting a "can't find error" at Me.ParentOrProvider, what happens if you use a bang operator? For example:
Code:
Me!ParentOrProider


Me! = No good.
 

June7

AWF VIP
Local time
Today, 10:10
Joined
Mar 9, 2014
Messages
5,466
Make a copy of frontend, remove table links and import data to local tables, remove confidential info.

Unfortunately, I cannot test Access 2016.
 

KACJR

Registered User.
Local time
Today, 14:10
Joined
Jul 26, 2012
Messages
81
Something amiss in Access 2016???


I just took the last good version of the DB and made the same changes to the DB using Access 2010 and no errors are being thrown, either in Access 2010 or Access 2016.


This is weird.
 

KACJR

Registered User.
Local time
Today, 14:10
Joined
Jul 26, 2012
Messages
81
Sorry, what does "no good" mean? Did you get the same error message? Did you notice the typo I had earlier?


Yes. I noticed the typo.


I changed all Me. references to Me!...these did not work.
 

theDBguy

I’m here to help
Staff member
Local time
Today, 11:10
Joined
Oct 29, 2018
Messages
21,454
Yes. I noticed the typo.


I changed all Me. references to Me!...these did not work.
Hi. Sorry again, since we cannot see what you're doing, saying "did not work" doesn't tell us much to be able to help you. For example, let us know if you received an error or it didn't do what you expected to happen. In which case, what exactly did it do? A little more info might help us pinpoint the problem better. Thanks.
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 13:10
Joined
Feb 28, 2001
Messages
27,146
I just took the last good version of the DB and made the same changes to the DB using Access 2010 and no errors are being thrown, either in Access 2010 or Access 2016.

"No errors are being thrown." Does that mean the problem is now solved?

If that is NOT what you meant, please try to be more precise in what you tell us.
 

Users who are viewing this thread

Top Bottom