David-
To set a stop, either place the command Stop just before the code you want to debug, or open the code in the VB Editor and click the vertical bar to the left opposite the line on which you want to halt. That should put a red dot on the bar next to the line. Then do something to cause the code to run. That will open the VB Editor with your code halted and the halted line highlighted. Open the Debug menu and use Step Into or Step Over to go through one line at a time. The difference between Into and Over - if the code is about to call one of your functions or subs, Into will step "into" that code where you can continue one line at a time. If you choose Over when on a line about to call your code, it will run the code and stop again in the code you're debugging.
John Viescas, Author
Effective SQL
SQL Queries for Mere Mortals
Microsoft Access 2010 Inside Out
Microsoft Access 2007 Inside Out
Microsoft Access 2003 Inside Out
Building Microsoft Access Applications
(Paris, France)
On Jan 1, 2017, at 9:57 PM, david.pratt@outlook.com [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com> wrote:
yes correct. it compiles but fails on run
my VBE skills are very poor as of yet so I don't know how to do what you are saying so it will take me a while to get back to you while I "play" with it.
---In MS_Access_Professionals@yahoogroups.com, <JohnV@...> wrote :
David-
So, the code compiles OK, but fails when you run it?
Put a halt on the If statement, then move to a different record in your form. Use single step to figure out what's going wrong. You can also hover over the references to Me.txtTAPSort while the code is halted to see if VB can find that.
John Viescas, Author
Effective SQL
SQL Queries for Mere Mortals
Microsoft Access 2010 Inside Out
Microsoft Access 2007 Inside Out
Microsoft Access 2003 Inside Out
Building Microsoft Access Applications
(Paris, France)
On Jan 1, 2017, at 9:04 PM, david.pratt@... [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com> wrote:
Yes, intelllisense autofills txtTAPsort after the me.
It does not fill in after the me.parent
but I think you told me previously that it could "sense" the controls on the parent form
On Jan 1, 2017, at 8:18 PM, John Viescas <johnv@...> wrote:
David-
That looks fine as long as you actually have a control named txtTAPSort on the subform. When you type Me. in the VB Editor, does intellisense list that value in the drop-down list?
John Viescas, AuthorEffective SQLSQL Queries for Mere MortalsMicrosoft Access 2010 Inside OutMicrosoft Access 2007 Inside OutMicrosoft Access 2003 Inside OutBuilding Microsoft Access Applications(Paris, France)
On Jan 1, 2017, at 5:33 PM, david.pratt@... [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com> wrote:
I have the following in the OnCurrent Event procedure of a subform, and it is throwing an error. VBE tells me that "there is misuse or bang or dot operator or misuse of parenthesis. I have spend at least an hour just trying to make this work. I have tried multiple combinations of bangs, dots and parenthesis. Can you help me please.
If IsNull(Me.txtTAPSort) Or Me.txtTAPSort = "" Then
Me.txtTAPSort = Me.Parent.txtSampleSort
End If
I am trying to set the value of a control in a subform to = the value of a control in a main form, ONLY if the value in the subform has not already been set. I don't know if this is the correct Event to use and can't try it out because I can't get it to execute.
VBE hangs up on the first IF THEN line
I have almost exactly the same format for an IF statement in a different Event and it works perfectly.
__._,_.___
Posted by: John Viescas <johnv@msn.com>
Reply via web post | • | Reply to sender | • | Reply to group | • | Start a New Topic | • | Messages in this topic (6) |
Have you tried the highest rated email app?
With 4.5 stars in iTunes, the Yahoo Mail app is the highest rated email app on the market. What are you waiting for? Now you can access all your inboxes (Gmail, Outlook, AOL and more) in one place. Never delete an email again with 1000GB of free cloud storage.
.
__,_._,___
Tidak ada komentar:
Posting Komentar