Minggu, 01 Januari 2017

Re: [MS_AccessPros] Invalid IF

 

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@outlook.com [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@msn.com> 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, 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 5:33 PM, david.pratt@outlook.com [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 (4)

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