UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> Help, Access 2016    
 
   
azizrasul
post May 30 2019, 04:17 AM
Post#1



Posts: 1,463
Joined: 18-July 00
From: Faisalabad, Pakistan


I have a database given to me that I am struggling with.
There is a main form with subform that contains command buttons.

Whether I open the subform directly or use the main form to press a command button on a subform, the problem is the same. I have placed a breakpoint on the first line of code. Here's the code.

CODE
Private Sub Command92_Click()

    Dim x As Long, i As Long
    
    For x = 1 To 200000000
        i = i + 1
    Next x

    DoCmd.OpenTable "dbo_dbo_TBL_detailedFC", acViewNormal    
    MsgBox "Test", vbOKOnly
    
End Sub


The code doesn't stop at the breakpoint and doesn't open the message box but it does open the "dbo_dbo_TBL_detailedFC" table.

Why doesn't the code halt at the breakpoint and why can't I see the message box? I do see a screen change momentarily. Is the message box opening but it's hidden?

I have never come across anything like this before. Is it a different kind of form that the previous user has created?

When I run the same code with a copy of the database on my C drive then everything works as normal. When it is run on the network drive I have the above problems.
This post has been edited by azizrasul: May 30 2019, 04:20 AM

--------------------
Aziz
Go to the top of the page
 
Phil_cattivocara...
post May 30 2019, 04:31 AM
Post#2



Posts: 351
Joined: 2-April 18



I cannot explain the reason why breakpoint and msgbox do not appear and why this appens only with files on a network drive but... would you try to be "rude"? Write STOP a line before For and the code will stop. Then you can continue with F8 - step by step.
This post has been edited by Phil_cattivocarattere: May 30 2019, 04:45 AM

--------------------
Please forgive in advance my horrible English.
Go to the top of the page
 
azizrasul
post May 30 2019, 04:38 AM
Post#3



Posts: 1,463
Joined: 18-July 00
From: Faisalabad, Pakistan


Tried that but it makes no difference.

--------------------
Aziz
Go to the top of the page
 
Phil_cattivocara...
post May 30 2019, 04:46 AM
Post#4



Posts: 351
Joined: 2-April 18



Perhaps: Warnings are disabled (by code DoCmd.SetWarnings = False) or Alerts (Application.DispalyAlerts = False). Verify Warnings, before.
Or... are you under Windows Domain or such a thing?

--------------------
Please forgive in advance my horrible English.
Go to the top of the page
 
azizrasul
post May 30 2019, 04:52 AM
Post#5



Posts: 1,463
Joined: 18-July 00
From: Faisalabad, Pakistan


But I am only trying to halt the code and opening a message box. The warnings are off in any case.
Is it to do with a specific type of form?
This post has been edited by azizrasul: May 30 2019, 04:52 AM

--------------------
Aziz
Go to the top of the page
 
Minty
post May 30 2019, 05:29 AM
Post#6



Posts: 312
Joined: 5-July 16
From: UK - Wiltshire


QUOTE
I have placed a breakpoint on the first line of code.


Where explicitly did you place the break point?
And did you save the code module before running it?
Go to the top of the page
 
azizrasul
post May 30 2019, 05:38 AM
Post#7



Posts: 1,463
Joined: 18-July 00
From: Faisalabad, Pakistan


I placed the breakpoint on

CODE
For x = 1 To 200000000


Yes I did save the code. I closed the db and reopened it and run it again, but same problem. The code was still there as previously.

--------------------
Aziz
Go to the top of the page
 
cheekybuddha
post May 30 2019, 06:00 AM
Post#8


UtterAccess VIP
Posts: 11,487
Joined: 6-December 03
From: Telegraph Hill


Hi Aziz,

Is the main form a 'Navigation Form'?

From reading on UA, they can behave differently from normal forms.

Other things to check: are you sure the subform control is using the SourceObject form that you are expecting (ie the onoe you are putting the breakpoint in)?

--------------------


Regards,

David Marten
Go to the top of the page
 
azizrasul
post May 30 2019, 06:16 AM
Post#9



Posts: 1,463
Joined: 18-July 00
From: Faisalabad, Pakistan


How do I determine that it's a navigation form? I have attached a screenshot to this post.

As for your second point, I even tried to open the form within the form directly and pressed the command button.
Attached File(s)
Attached File  Doc4.zip ( 144.84K )Number of downloads: 5
 

--------------------
Aziz
Go to the top of the page
 
mike60smart
post May 30 2019, 06:57 AM
Post#10


UtterAccess VIP
Posts: 13,369
Joined: 6-June 05
From: Dunbar,Scotland


Hi

Looks like a Navigation Form but may be wrong.

Would need to see the actual Db to be sure


--------------------
Hope this helps?

Mike

Get happiness out of your work or you may never know what happiness is.

Go to the top of the page
 
azizrasul
post May 30 2019, 08:33 AM
Post#11



Posts: 1,463
Joined: 18-July 00
From: Faisalabad, Pakistan


Problem solved.

It had nothing to do with the database being on the network drive as I copied the network version and placed it on my C drive and I experienced the same problems. I then compared the db Options of my original C drive version, which did work, and in conclusion I had the USE ACCESS SPECIAL KEYS ticked while the network version was unticked. Hurrah. That's a load of my mind. Thanks to all who contributed.

Hope this helps someone else in the future.
This post has been edited by azizrasul: May 30 2019, 08:33 AM

--------------------
Aziz
Go to the top of the page
 
jleach
post May 30 2019, 02:28 PM
Post#12


UtterAccess Editor
Posts: 10,097
Joined: 7-December 09
From: St Augustine, FL


Good, now you can remove that ridiculous loop! smile.gif

--------------------
Go to the top of the page
 
azizrasul
post May 30 2019, 05:16 PM
Post#13



Posts: 1,463
Joined: 18-July 00
From: Faisalabad, Pakistan


That's true. smile.gif

--------------------
Aziz
Go to the top of the page
 


Custom Search


RSSSearch   Top   Lo-Fi    22nd September 2019 - 05:12 AM