Property Not Found - 3270 - For some users and not others (1 Viewer)

mzoucha

New member
Local time
Yesterday, 20:59
Joined
Jul 22, 2019
Messages
4
I have this code in the Current() event for the "home page" of a database I built for work, in order to force the database into tabbed view instead of overlapping windows (it seems any time I sync changes to the database, it defaults everyone's copies back to overlapping windows):

Private Sub Form_Current()

If CurrentDb.Properties("UseMDIMode") <> 0 Then

CurrentDb.Properties("UseMDIMode") = 0

Dim Msg, Style, TITLE

Msg = "Please reopen the database to complete the sync."
Style = vbOKOnly
TITLE = "Sync Needed!"
Response = MsgBox(Msg, Style, TITLE)
If Response = vbOK Then
DoCmd.Quit
Else
DoCmd.Quit
End If

End If

End Sub

It works flawlessly on my computer every time, but I have coworkers that get a 3270 error "Property Not Found" when it executes on their computers. Is there anything I can do to fix this? They are forced to hit 'END' and the database opens in overlapping window -- which defeats the purpose of the code.
 

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 18:59
Joined
Oct 29, 2018
Messages
21,358
Hi. Welcome to the forum! Some database properties have to be created first before you can use them. You could add an error handler to trap the error and create the property and set it, if it doesn't exist.
 

mzoucha

New member
Local time
Yesterday, 20:59
Joined
Jul 22, 2019
Messages
4
Thanks for the quick response. Is there any reason why it wouldn't need to be created when I run it, but for others it needs to be? I have pretty good VBA and Access knowledge, but this one has been throwing me for a loop!
 

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 18:59
Joined
Oct 29, 2018
Messages
21,358
Thanks for the quick response. Is there any reason why it wouldn't need to be created when I run it, but for others it needs to be? I have pretty good VBA and Access knowledge, but this one has been throwing me for a loop!
To test the theory, try creating a new blank database but don't change any default settings. Then add your code and run it to see if you get an error or not. Let us know how it goes.
 

mzoucha

New member
Local time
Yesterday, 20:59
Joined
Jul 22, 2019
Messages
4
I created the new database, and the code worked fine, like it does in my copy of the database in question, so I am just really stumped why it isn't working for some of my coworkers when they get into it. It is online through Sharepoint, with local copies on everyone's computer, but that shouldn't make a difference either right?
 

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 18:59
Joined
Oct 29, 2018
Messages
21,358
I created the new database, and the code worked fine, like it does in my copy of the database in question, so I am just really stumped why it isn't working for some of my coworkers when they get into it. It is online through Sharepoint, with local copies on everyone's computer, but that shouldn't make a difference either right?
No, I don't think it would matter. By putting the file in SharePoint, it means the users have to download a copy before they can use it. So, if the code works before you upload it to SharePoint, then it's expected to still work after they downloaded it.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 09:59
Joined
May 7, 2009
Messages
19,169
you can add the Property, if not found, so as not to throw error

Code:
Private Sub Form_Current()
On Error Goto Err_Handler
Dim Db As DAO.Database
set Db=currentdb
If Db.Properties("UseMDIMode") <> 0 Then

	Db.Properties("UseMDIMode") = 0

	Dim Msg, Style, TITLE

	Msg = "Please reopen the database to complete the sync."
	Style = vbOKOnly
	TITLE = "Sync Needed!"
	Response = MsgBox(Msg, Style, TITLE)
	If Response = vbOK Then
		DoCmd.Quit
	Else
		DoCmd.Quit
	End If

End If
Exit_Handler:
	Exit Sub
Err_Handler:
If err.Number = 3270 Then
	Dim prp As Property
	Set prp = db.CreateProperty("UseMDIMode", dbInteger, 1)
	Db.Properties.Append prp
	Resume Next
Else
	'other error here
	Msgbox err.Number & ": " & err.Description
	Resume Exit_Handler
End If
End Sub
 

JHB

Have been here a while
Local time
Today, 02:59
Joined
Jun 17, 2012
Messages
7,732
Do you and the coworkers use the same MS-Access version?
 

mzoucha

New member
Local time
Yesterday, 20:59
Joined
Jul 22, 2019
Messages
4
They are using Access 2016, and I built the database on 2010. (I have a computer at work still on Windows 7, hence the 2010 version) I also have one on Windows 10 using 2016, and the code was working fine for both of them, which is why I didn't take the version into account. Is there something in 2016 that would prevent it from executing for them, but not for me?:banghead:
 

Users who are viewing this thread

Top Bottom