Go Back   Access World Forums > Microsoft Access Discussion > Modules & VBA

 
Reply
 
Thread Tools Rate Thread Display Modes
Old 01-10-2019, 01:12 PM   #46
psyc0tic1
Access Moron
 
Join Date: Jul 2017
Posts: 360
Thanks: 168
Thanked 7 Times in 4 Posts
psyc0tic1 is on a distinguished road
Re: Check for newest DB version?

Quote:
Originally Posted by Gasman View Post
Make it a string and run the string, after you debug.print the string
I do not know how to do that

__________________
Richard
Access 2013, Windows 7 64 bit
psyc0tic1 is offline   Reply With Quote
Old 01-10-2019, 01:16 PM   #47
psyc0tic1
Access Moron
 
Join Date: Jul 2017
Posts: 360
Thanks: 168
Thanked 7 Times in 4 Posts
psyc0tic1 is on a distinguished road
Re: Check for newest DB version?

I don't have an issue on my computer... it is happening to one of my users overseas. I have no idea what version of office they have or what version of windows they are using. Terrible language barrier and always 24 hours delay in getting answers
__________________
Richard
Access 2013, Windows 7 64 bit
psyc0tic1 is offline   Reply With Quote
Old 01-10-2019, 01:17 PM   #48
psyc0tic1
Access Moron
 
Join Date: Jul 2017
Posts: 360
Thanks: 168
Thanked 7 Times in 4 Posts
psyc0tic1 is on a distinguished road
Re: Check for newest DB version?

This is the whole block of code
Code:
Private Sub Form_Open(Cancel As Integer)
    Dim dbs As DAO.Database
    Dim FEVersion As Variant

    Set dbs = CurrentDb
    If Credentials.AccessLvlID = 0 Then
        DoCmd.OpenForm "frm_loginform"
        Cancel = 1
    End If
    
    If Credentials.UserId = 2 Then
        If Weekday(Now) = vbMonday Then
            WaitVis
            WaitLab
            SendEMail
        End If
    End If

    If Credentials.UserId = 2 Then
        dbs.Execute "AppendNewPONumbers", dbFailOnError
        dbs.Execute "AppendNewPoNumbers_WNK", dbFailOnError
    End If

        FEVersion = DLookup("fe_version_number", "tbl-fe_version")
        DoCmd.SetWarnings False
        DoCmd.RunSQL "UPDATE tbl_users SET Version = '" & FEVersion & "' WHERE ID = " & Credentials.UserId
    
    If Credentials.AccessLvlID = 6 Then
        MsgBox "Your Account Has Been Deactivated. Please Contact the Administrator."
        DoCmd.Quit
    End If
End Sub

__________________
Richard
Access 2013, Windows 7 64 bit
psyc0tic1 is offline   Reply With Quote
Old 01-11-2019, 04:08 AM   #49
Gasman
Enthusiastic Amateur
 
Join Date: Sep 2011
Location: Swansea, South Wales,UK
Posts: 3,131
Thanks: 348
Thanked 531 Times in 513 Posts
Gasman has a spectacular aura about Gasman has a spectacular aura about
Re: Check for newest DB version?

Quote:
Originally Posted by psyc0tic1 View Post
I don't have an issue on my computer... it is happening to one of my users overseas. I have no idea what version of office they have or what version of windows they are using. Terrible language barrier and always 24 hours delay in getting answers
Well that complicates matters.
My suggestion was to do this
Code:
Dim strSQL as String
...
....
strSQL = "UPDATE tbl_users SET Version = '" & FEVersion & "' WHERE ID = " & Credentials.UserId
DoCmd.RunSQL strSQL
Now you can set a breakpoint on the DoCmd line or insert a Debug.Print between those lines and see what the string actually contains.

At present you are assuming there are valid values for FEVersion and Credentials.UserId. If there were, the syntax should be correct.?

So my 'guess' is one of those has no or invalid content.? if this has been working fine and not been changed, then it can only be the data that is causing it.?

HTH
__________________
Access novice. Sometimes trying to give something back.
Access 2007


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Gasman is offline   Reply With Quote
Old 01-11-2019, 11:22 AM   #50
psyc0tic1
Access Moron
 
Join Date: Jul 2017
Posts: 360
Thanks: 168
Thanked 7 Times in 4 Posts
psyc0tic1 is on a distinguished road
Re: Check for newest DB version?

Quote:
Originally Posted by Gasman View Post
Well that complicates matters.
My suggestion was to do this
Code:
Dim strSQL as String
...
....
strSQL = "UPDATE tbl_users SET Version = '" & FEVersion & "' WHERE ID = " & Credentials.UserId
DoCmd.RunSQL strSQL
Now you can set a breakpoint on the DoCmd line or insert a Debug.Print between those lines and see what the string actually contains.

At present you are assuming there are valid values for FEVersion and Credentials.UserId. If there were, the syntax should be correct.?

So my 'guess' is one of those has no or invalid content.? if this has been working fine and not been changed, then it can only be the data that is causing it.?

HTH
The printout is
Code:
UPDATE tbl_users SET Version = 'v018' WHERE ID = 1
ID = 1 is my login

I tested the users login that is having the issue on my computer and their login works and their version number is already correct because I haven't published any updates in weeks.

I asked them to send me a screenshot of the highlighted code when they get the error but they have not responded. I know it is the update code I posted because it is the only update code running when they click the OK button on the message box preceding the error.

Hard to fix a problem you can't reproduce.
__________________
Richard
Access 2013, Windows 7 64 bit
psyc0tic1 is offline   Reply With Quote
Old 01-11-2019, 12:19 PM   #51
Gasman
Enthusiastic Amateur
 
Join Date: Sep 2011
Location: Swansea, South Wales,UK
Posts: 3,131
Thanks: 348
Thanked 531 Times in 513 Posts
Gasman has a spectacular aura about Gasman has a spectacular aura about
Re: Check for newest DB version?

Send the offending user another accde that has a MSGBOX to show the SQL string.

Whilst MS have issued a few updates to cock up Access functionality, I've not heard of this one.

Alternatively login on to their computer via your support portal and do what you can over the net.

Regardless, you really need to see what that statement is.?
__________________
Access novice. Sometimes trying to give something back.
Access 2007


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Gasman is offline   Reply With Quote
Old 01-11-2019, 01:49 PM   #52
psyc0tic1
Access Moron
 
Join Date: Jul 2017
Posts: 360
Thanks: 168
Thanked 7 Times in 4 Posts
psyc0tic1 is on a distinguished road
Re: Check for newest DB version?

Quote:
Originally Posted by Gasman View Post
Send the offending user another accde that has a MSGBOX to show the SQL string.

Whilst MS have issued a few updates to cock up Access functionality, I've not heard of this one.

Alternatively login on to their computer via your support portal and do what you can over the net.

Regardless, you really need to see what that statement is.?
That is a good idea about the message box... I think I will do that... as far as connecting to their computer... they are in Viet Nam... and I am not a network admin so this probably will be difficult. Maybe I can catch them tonight (their morning) over Skype for business and have them allow me control of the computer that way.

Thanks Gasman

__________________
Richard
Access 2013, Windows 7 64 bit
psyc0tic1 is offline   Reply With Quote
Old 01-12-2019, 03:09 AM   #53
Gasman
Enthusiastic Amateur
 
Join Date: Sep 2011
Location: Swansea, South Wales,UK
Posts: 3,131
Thanks: 348
Thanked 531 Times in 513 Posts
Gasman has a spectacular aura about Gasman has a spectacular aura about
Re: Check for newest DB version?

Quote:
Originally Posted by psyc0tic1 View Post
I do not know how to do that
Rereading this thread, I can see I showed you how in post #41 ?

__________________
Access novice. Sometimes trying to give something back.
Access 2007


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Gasman is offline   Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Run Time Errors after upgrading to newest version jbroadnax Modules & VBA 2 01-16-2018 09:05 PM
version check code? joe789 General 1 03-28-2016 07:42 AM
Expression builder: for newest date and for newest time, then dmax number +1 ssgagosto Forms 3 10-20-2009 07:00 AM
FE version check ducker General 12 01-14-2005 12:15 PM
check version gbanks General 2 06-18-2003 12:22 AM




All times are GMT -8. The time now is 01:19 AM.


Microsoft Access Help
General
Tables
Queries
Forms
Reports
Macros
Modules & VBA
Theory & Practice
Access FAQs
Code Repository
Sample Databases
Video Tutorials

Featured Forum post


Sponsored Links


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
(c) copyright 2017 Access World