Go Back   Access World Forums > Microsoft Access Discussion > Access Web

 
Reply
 
Thread Tools Rate Thread Display Modes
Old 12-21-2018, 02:58 AM   #16
Cliff67
Newly Registered User
 
Join Date: Oct 2018
Location: Southend-On-Sea, Essex, UK
Posts: 60
Thanks: 23
Thanked 1 Time in 1 Post
Cliff67 is on a distinguished road
Re: Remote Access to Database

Hi Colin

many thanks for that, I've mainly developed desktop databases with multi-user access so remote access is really new to me - I found it easier in the days of replicated databases with a master and slave databases. Just a quick question, would you use the active controls dirty function to detect if the control has been used?
I assume I would use something like this to set it initially

Dim ctlCurrentControl As Control
Dim strControlName As String
Set ctlCurrentControl = Screen.ActiveControl

if ctlCurrentControl.dirty then
insert timer reset here
else
do the time out bit here
end if

Cliff67 is offline   Reply With Quote
Old 12-21-2018, 04:42 AM   #17
isladogs
Part time moderator
 
isladogs's Avatar
 
Join Date: Jan 2017
Location: Somerset, UK
Posts: 8,633
Thanks: 102
Thanked 2,279 Times in 2,100 Posts
isladogs is a name known to all isladogs is a name known to all isladogs is a name known to all isladogs is a name known to all isladogs is a name known to all isladogs is a name known to all
Re: Remote Access to Database

I just check what the active form and control name are in the timer event and whether they are identical to those in the previous check
Here's part of the code I use:

Code:
CheckActivity:
'-------------------------------------------------------------
'This section detects if the current active control does not change for a pre-set time.
'If after this time there is no change, form frmSystemMessages opens
'and gives the user 30 seconds to cancel, otherwise it closes the program.

'The Global variable intTimeDelay determines how much idle time to wait (in seconds) before running the IdleTimeDetected subroutine.
   
Static PrevControlName As String
Static PrevFormName As String
Static ExpiredTime
Static Timeout

Dim ActiveFormName As String
Dim ActiveControlName As String
Dim ExpiredSeconds
Dim Lockout As String

On Error Resume Next

'Check to see if any program activity
If intTimeDelay > 0 Then
'Get the active form and control name.
    ActiveFormName = Screen.ActiveForm.Name
    If Err Then
       ActiveFormName = "No Active Form"
       Err = 0
    End If
    
    ActiveControlName = Screen.ActiveControl.Name
       If Err Then
       ActiveControlName = "No Active Control"
       Err = 0
    End If

    ' Record the current active form and control and reset ExpiredTime if:
    '  1. They have not been recorded yet (code is running for the first time).
    '  2. The previous names are different than the current ones
    '       (the user has done something different during the timer interval)
    
    If PrevControlName = "" Or PrevFormName = "" Or ActiveFormName <> PrevFormName Or _
    ActiveFormName = "frmLogoutStatus" Or ActiveControlName <> PrevControlName Then
       PrevControlName = ActiveControlName
       PrevFormName = ActiveFormName
       ExpiredTime = 0  'reset
    Else
       '  . . .otherwise the user was idle during the time interval, so
       ExpiredTime = ExpiredTime + Me.TimerInterval  ' increment the total expired time.
    End If
    
    ' Does the total expired time exceed the intTimeDelay?
    ExpiredSeconds = (ExpiredTime / 1000)
   ' Debug.Print ExpiredSeconds
    If ExpiredSeconds >= CLng(intTimeDelay) Then 
       'Added clng() entering loop when intTimeDelay is larger than ExpiredSeconds
        '  . . .if so, then reset the expired time to zero . . .
        ExpiredTime = 0
        '  . . .and open the form frmSystemMessages if no activity
        If intTimeDelay > 60 Then
            strMsg = "No user activity has been detected in the last " & CLng(intTimeDelay / 60) & " minutes."
        Else
            strMsg = "No user activity has been detected in the last " & intTimeDelay & " seconds."
        End If
        
        InactivityFlag = True
        
        DoCmd.OpenForm "frmSystemMessages", , , , , acDialog, "ShutDown"
    End If
End If
HTH
__________________
If this answer has helped, please click the Thanks button and/or click the 'reputation scales' symbol on the left.

Website links:
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


Colin
Access 2010 32-bit, Access 2016 32-bit & 64-bit, SQL Server Express 2014, Windows 10,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
isladogs is offline   Reply With Quote
The Following User Says Thank You to isladogs For This Useful Post:
Cliff67 (12-21-2018)
Old 12-21-2018, 05:24 AM   #18
Cliff67
Newly Registered User
 
Join Date: Oct 2018
Location: Southend-On-Sea, Essex, UK
Posts: 60
Thanks: 23
Thanked 1 Time in 1 Post
Cliff67 is on a distinguished road
Re: Remote Access to Database

Wow Thanks Colin.
I have started to work my way through the code based on the ideas you gave me, this gives me some extra things to think about implementing. I normally develop one part and test it to see what goes wrong then 'bug fix' I know what I want to do and I tend to write it in pseudo-English then code. I hadn't thought of checking for the control name before everything. Guess that is why I started with a debug at the first timer event lol.

Cliff67 is offline   Reply With Quote
Old 12-21-2018, 05:50 AM   #19
isladogs
Part time moderator
 
isladogs's Avatar
 
Join Date: Jan 2017
Location: Somerset, UK
Posts: 8,633
Thanks: 102
Thanked 2,279 Times in 2,100 Posts
isladogs is a name known to all isladogs is a name known to all isladogs is a name known to all isladogs is a name known to all isladogs is a name known to all isladogs is a name known to all
Re: Remote Access to Database

You're welcome
Good luck with your project
__________________
If this answer has helped, please click the Thanks button and/or click the 'reputation scales' symbol on the left.

Website links:
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


Colin
Access 2010 32-bit, Access 2016 32-bit & 64-bit, SQL Server Express 2014, Windows 10,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
isladogs is offline   Reply With Quote
Old 12-21-2018, 06:12 AM   #20
Cliff67
Newly Registered User
 
Join Date: Oct 2018
Location: Southend-On-Sea, Essex, UK
Posts: 60
Thanks: 23
Thanked 1 Time in 1 Post
Cliff67 is on a distinguished road
Re: Remote Access to Database

Cheers, Have a good Christmas, I'm off soon until the new year
Cliff67 is offline   Reply With Quote
Old 12-21-2018, 07:01 AM   #21
The_Doc_Man
Happy Retired Curmudgeon
 
Join Date: Feb 2001
Location: Suburban New Orleans, LA, USA
Posts: 13,124
Thanks: 70
Thanked 1,375 Times in 1,267 Posts
The_Doc_Man is a splendid one to behold The_Doc_Man is a splendid one to behold The_Doc_Man is a splendid one to behold The_Doc_Man is a splendid one to behold The_Doc_Man is a splendid one to behold The_Doc_Man is a splendid one to behold The_Doc_Man is a splendid one to behold
Re: Remote Access to Database

Quote:
It might be worth my while logging the form/control usage on the lesser used ones
Concur. Not only would you get a sense of popularity (for lack of a better term) but you would be able to tune the timers. And knowing which forms are used most also helps you choose which forms need more tweaking, 'cause we ALL know that you never get ANYTHING exactly right the first time. It will tell you where to focus. And it will also tell you where to look for possible optimization efforts.

Not only that, but having a form usage entry in a log (and maybe a form exit) will help you debug crashes, if any, because you would have a hint as to trouble sources. In my case, I logged form & report opening, form closing, and all ACTIVE button clicks like SAVE and CANCEL and ENTER (meaning "new record" in my case) and REMOVE and such like that. Didn't log the HELP button and there were a couple of others that I didn't log - but ALL buttons updated the timer because that meant someone was there.
__________________
I'm a certified grandpa (3 times now) and proud of it.
Retired over one year and survived being home all day with the wife. She must really love me.
If I have helped you, please either click the thanks or click the scales.
The_Doc_Man is offline   Reply With Quote
Old 01-04-2019, 10:30 AM   #22
ahmedjamalaboelez
Newly Registered User
 
Join Date: Feb 2015
Posts: 10
Thanks: 6
Thanked 0 Times in 0 Posts
ahmedjamalaboelez is on a distinguished road
Re: Remote Access to Database

Heather ,
I was suffering of the Same Problem long time ago , but The Good News, there's a possible way , its fast solution with stable performance ,
- Use LOGMEIN HAMATCHI VPN NETWORK , I already Use it , so MS access database can connect Through The Real IP Of The VPN Network Created By HAMATCHI , I Already Have Remote Server , Contains SqlServer2014 - i already attached split access database back end in SQLSERVER and i connect with MS Access App Front End With Linked Tables

ahmedjamalaboelez is offline   Reply With Quote
Old 01-04-2019, 03:12 PM   #23
The_Doc_Man
Happy Retired Curmudgeon
 
Join Date: Feb 2001
Location: Suburban New Orleans, LA, USA
Posts: 13,124
Thanks: 70
Thanked 1,375 Times in 1,267 Posts
The_Doc_Man is a splendid one to behold The_Doc_Man is a splendid one to behold The_Doc_Man is a splendid one to behold The_Doc_Man is a splendid one to behold The_Doc_Man is a splendid one to behold The_Doc_Man is a splendid one to behold The_Doc_Man is a splendid one to behold
Re: Remote Access to Database

A VPN will work but there is still the issue that if the VPN "rides" a WAN, it will be less stable than a LAN. It will always be about the reliability of the VPN.

Not to downplay ahmedjamalaboelez's attempt to help. It IS a solution. Just be sure that you understand the stability metrics of the connection. A connection that crashes on a VPN is just as damaging as a connection that crashes on a WAN. Does exactly the same damage. Takes just as long to repair. Go into such a solution with your eyes open. But in the same paragraph, thanks for the suggestion, ahmedjamalaboelez.

__________________
I'm a certified grandpa (3 times now) and proud of it.
Retired over one year and survived being home all day with the wife. She must really love me.
If I have helped you, please either click the thanks or click the scales.
The_Doc_Man 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
Insert Data From Remote Access Database to a Local Access Database twcaddell Modules & VBA 3 01-26-2015 06:02 PM
Remote Database Access abbaddon223 General 7 06-22-2010 02:30 AM
[SOLVED] Remote DataBase Access aimran Tables 0 06-12-2006 09:00 PM
Web Programming or remote database access peggypph General 2 10-24-2004 02:53 AM
[SOLVED] Remote Access to a Database Adam Highbury General 8 08-21-2003 04:00 AM




All times are GMT -8. The time now is 01:42 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