passed function argument not arriving to function?

RAYLWARD102

Well-known Member
Joined
May 27, 2010
Messages
529
I have a function I wrote years ago.
I'm not sure why, but sometimes, the string sent, is arriving empty to the function; not sure how this can be happening.
This is very strange.


VBA Code:
Function FrameLoad102(ByVal MyQuery As String)
    MsgBox MyQuery
End Function


'function call method
FrameLoad102 "SELECT TOP 75 * FROM landscape.dbo.allocate WHERE deleted = 0 ORDER BY ID DESC"
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
What I failed to mention, is how the "select top 75...." was stored in a variant. Never had this problem before, but seeing strange things happening with excel vba where a variable isn't storing.
Example:
VBA Code:
'the memkeep variable is declared in my Module1 declarations as 'Public memkeep as Variant'

ReDim memkeep(0 To 6, 0 To 1)
memkeep(5, 0) = 1

when debugging, no error are thrown, but can see memkeep(5,0) = empty (very unusual)
Was there some recent updates that have screwed vba? Happening on all of our computers, running office 365 enterprise, fully updated.
 
Upvote 0

Forum statistics

Threads
1,224,730
Messages
6,180,607
Members
452,991
Latest member
JM_000888

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top