473,382 Members | 1,809 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

declaration

I would like to pass full name (path) of a list box (ListBoxName) to a
function, so that I can reference it inside the function as
ListBoxFullName.Column(0, varItem).
How should I declare ListBoxFullName ? As object, name, string or something
else?

Zlatko

Jan 18 '06 #1
4 1461
Pass the list box instead of it's name.
You can then get at any of its properties or methods.

Example:
Function DoSomething(lst As Listbox)
Debug.Print "The list box is called " & lst.Name
End Function

Then call it like this:
Call DoSomething(Me.[NameOfYourListBoxHere])

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Zlatko Matif" <zl***********@sb.t-com.hr> wrote in message
news:dq**********@ss405.t-com.hr...
I would like to pass full name (path) of a list box (ListBoxName) to a
function, so that I can reference it inside the function as
ListBoxFullName.Column(0, varItem).
How should I declare ListBoxFullName ? As object, name, string or
something else?

Jan 18 '06 #2
Per Allen Browne:
Then call it like this:
Call DoSomething(Me.[NameOfYourListBoxHere])


Any reason for using "Call..." instead of

DoSomething me.lstWhatever

?
--
PeteCresswell
Jan 18 '06 #3
Call is optional.

I prefer it because because:
a) It works in all versions, regardless of whether DoSomething is a Sub or
Function.
b) It standardizes the way arguments are passed (bracketing.)
c) It distinguishes a user-defined procedure from a built-in keyword.
which to me seems more consistent and readable (so maintainable.)

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"(PeteCresswell)" <x@y.Invalid> wrote in message
news:ob********************************@4ax.com...
Per Allen Browne:
Then call it like this:
Call DoSomething(Me.[NameOfYourListBoxHere])


Any reason for using "Call..." instead of

DoSomething me.lstWhatever

?
--
PeteCresswell

Jan 18 '06 #4
OK. it should be declared as Control.

"Zlatko Matić" <zl***********@sb.t-com.hr> je napisao u poruci interesnoj
grupi:dq**********@ss405.t-com.hr...
I would like to pass full name (path) of a list box (ListBoxName) to a
function, so that I can reference it inside the function as
ListBoxFullName.Column(0, varItem).
How should I declare ListBoxFullName ? As object, name, string or
something else?

Zlatko

Jan 19 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

83
by: Alexander Zatvornitskiy | last post by:
Hello All! I'am novice in python, and I find one very bad thing (from my point of view) in language. There is no keyword or syntax to declare variable, like 'var' in Pascal, or special syntax in...
8
by: newmans | last post by:
Perhaps one of the experts can straighten me out on this point... In Bjarne Stroustrup's book 'The C++ Programming Language' 3rd Edition, section 4.9, indicates that typedef complex<short>...
10
by: Kobu | last post by:
My question is about the use and meaning of the terms "declaration" and "definition" as it pertains to the C language. I've read sources that mix the two up when talking about such things as...
25
by: venky | last post by:
Hi main() { int x; /* it declaration or defination??*/ }
4
by: nospam_timur | last post by:
Let's say I have two files, myfile.h and myfile.c: myfile.h: int myfunction(int x); myfile.c: #include "myfile.h"
9
by: Jess | last post by:
Hello, I was told that if I declare a static class constant like this: class A{ static const int x = 10; }; then the above statement is a declaration rather than a definition. As I've...
2
by: Alan | last post by:
Does a template class declaration, like template <class T> have to come immediately prior to the declaration of the function, e.g., T do_something (T something) { . . . } that uses it?
15
by: vaib | last post by:
hi to all.i'd like to know the actual difference between variable declaration and definition.it would be very helpful if anyone out there wud help me out with this thing.i'm writing here after here...
6
by: WaterWalk | last post by:
I find friend declaration just very tricky. I tried the following examples on both MingW(gcc 3.4.2) and VC++ 2005. The results are surprising. Example1: namespace ns1 { class Test { friend...
10
by: tvnaidu | last post by:
I am using Three pthread functions below, I got ISO error, then I declared int variable called val123, then I assigned, but still I am getting error, any idea?. also I included pthread.h. compiling...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.