Do functions vary via access version (1 Viewer)

Benwatson

Registered User.
Local time
Yesterday, 19:16
Joined
Oct 11, 2016
Messages
26
Hi all

I have created a database in access 2016. now i also have access 2013 on my computer and when i open the database i experience no issues. but when my end user saves to their laptop they experience these issues

  • when logging in will keep flashing with a box if flashes to quickly to fully make out what it says but its something like "searching for reference to **** "
  • when going on to a form with any text boxes with a defualt value of =date() it will display "#name?"
  • Opening a form with a chart in opens with unable to retrieve expression error

so how come the end user is experiencing these issues and im not
 

Ranman256

Well-known member
Local time
Yesterday, 22:16
Joined
Apr 9, 2015
Messages
4,337
2016 seems to have lots of bugs like this, but the functions would not have changed.

There could be conflicts with API functions if the PC is 64bit vs using 32 bit functions.
these are corrected with :
Code:
#if Win64 then
   Declare PtrSafe Function MyMathFunc Lib "User32" (ByVal N As LongLong) As LongLong
#else
   Declare Function MyMathFunc Lib "User32" (ByVal N As Long) As Long
#end if

defualt value of =date(), SHOULD work. This could be a bug.
(thanks Microsoft)
 

CJ_London

Super Moderator
Staff member
Local time
Today, 03:16
Joined
Feb 19, 2013
Messages
16,610
unlikely to affect all the issues, but as new versions of Access come out, the code becomes less tolerant of poor coding. Whereas something might have worked before. it now generates an error. I don't have specific examples but strongly recommend you ensure all modules have 'option explicit' at the top, just below 'Option Compare Database' and then compile the code.
 

CJ_London

Super Moderator
Staff member
Local time
Today, 03:16
Joined
Feb 19, 2013
Messages
16,610
its also possible your end user is accessing external files that he either cannot access for security reasons or are on a different path.

No thoughts on the default value. There was a (2016) bug in table design for choosing a number type, but that has apparently been fixed.
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Yesterday, 21:16
Joined
Feb 28, 2001
Messages
27,179
If your end user has 2013 and you saved a file in 2016 format, you can have a reference issue because your app would require a step-down. If/when a new version of Access comes out, many (but not all) of the resource libraries change version numbers. So your version built on 2016 foundations uses the 2016 libraries. But if your users have 2013, they first don't have the 2016 libraries and second, Access normally will adjust for Access version changes - but this is a DOWN-shift, not an up-shift, and Access cannot step backwards.
 

Benwatson

Registered User.
Local time
Yesterday, 19:16
Joined
Oct 11, 2016
Messages
26
@RANMAN256 where would i input this code when they login or on application load?

Thanks for your input everyone really appriciate it, i found out what the screen that was popping up was trying to search for. It was searching for reference of MSOUTL.OLB file unsure how to fix this issue currently looking for solution if any of you know your feedback would be brilliant thank you again
 

CJ_London

Super Moderator
Staff member
Local time
Today, 03:16
Joined
Feb 19, 2013
Messages
16,610
Ranman is offline at the moment

Google MSOUTL.OLB and you will find a number of answers for different things to try.

If it is a missing reference, then this implies you have invoked the outlook library in VBA, so you will need to go into references to fix it. Or perhaps your user does not have outlook installed.

Using these libraries is called early binding and is useful whilst developing because you have access to the variables via dropdowns etc. However it can cause versioning problems such as you are experiencing.

The solution is once development is complete is to convert to late binding. Too big a subject for this thread but google 'early v late binding' to find out what the differences are and 'access vba late binding' or similar to find out how to convert.
 

Benwatson

Registered User.
Local time
Yesterday, 19:16
Joined
Oct 11, 2016
Messages
26
thanks CJ_LONDON just a question so i know i understand

this is early binding
Private Sub EmailPallet_Click()
Dim oApp As New Outlook.Application
Dim oemail As Outlook.MailItem

If Me.cmbShift = "Green" Then
Set oemail = oApp.CreateItem(olMailItem)
oemail.To = "someone"
oemail.CC = "someoneeles"
oemail.Subject =" HI "
oemail.Body = "Hope you have a good day"
oemail.Send

end if
end sub

this is late binding?
Private Sub EmailPallet_Click()
Dim oApp As Object
Dim oemail As Object

If Me.cmbShift = "Green" Then
set oApp = createobject("Outlook.Application")
Set oemail = oApp.CreateItem(olMailItem)
oemail.To = "someone"
oemail.CC = "someone else"
oemail.Subject = "HI"
oemail.Body = "have a good day"
oemail.Send
end if
end sub

or do i need to do more to it?
 

Benwatson

Registered User.
Local time
Yesterday, 19:16
Joined
Oct 11, 2016
Messages
26
thanks CJ_LONDON just a question so i know i understand

this is early binding
Private Sub EmailPallet_Click()
Dim oApp As New Outlook.Application
Dim oemail As Outlook.MailItem

If Me.cmbShift = "Green" Then
Set oemail = oApp.CreateItem(olMailItem)
oemail.To = "someone"
oemail.CC = "someoneeles"
oemail.Subject =" HI "
oemail.Body = "Hope you have a good day"
oemail.Send

end if
end sub

and this is Late binding?
Private Sub EmailPallet_Click()
Dim oApp As Object
Dim oemail As Object

If Me.cmbShift = "Green" Then
set oApp = createobject("Outlook.Application")
Set oemail = oApp.CreateItem(olMailItem)
oemail.To = "someone"
oemail.CC = "someone else"
oemail.Subject = "HI"
oemail.Body = "have a good day"
oemail.Send
end if
end sub

or do i need to do more?
 

CJ_London

Super Moderator
Staff member
Local time
Today, 03:16
Joined
Feb 19, 2013
Messages
16,610
correct - if late binding, don't forget to remove the library reference

the only bit I think you will need to change is

oApp.CreateItem(olMailItem)

olMailItem is a constant, so before removing the library check what its value is and then create a constant e.g.

Const olMailitem=1 (or whatever the value is)

You can check the value by entering

?olMailItem

in the vba immediate window, or hit F2 and find it in the object browser

providing you have option explicit at the top of the module, you can compile the code and it will identify any missing references when the library is removed
 

Users who are viewing this thread

Top Bottom